Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.event.*;
- import java.awt.*;
- public class test {
- JFrame spelRutan;
- public test() {
- spelRutan = new JFrame("orre");
- spelRutan.setSize(800,600);
- spelRutan.setVisible(true);
- spelRutan.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- spelRutan.setResizable(false);
- spelRutan.getContentPane().add(new MyComponent());
- }
- public class MyComponent extends JComponent {
- public void paint(Graphics g) {
- g.drawRect(60,60,60,60);
- g.setColor(Color.RED);
- g.fillRect(60,60,60,60);
- }
- }
- public static void main (String [] args) {
- new test();
- }
- }
Add Comment
Please, Sign In to add comment