Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.awt.*;
  2. import javax.swing.*;
  3. public class OKNA {
  4.  
  5. public static void main(String[] args) {
  6. myFrame okno = new myFrame();
  7. }
  8. }
  9. class myFrame extends JFrame
  10. {
  11. myPanel panel = new myPanel();
  12. Container cont = getContentPane();
  13. cont.add(panel);
  14. setBounds(10, 10, 300, 400);
  15. setVisible(true);
  16. }
  17. class myPanel extends JPanel
  18. {
  19. public void paintComponent(Graphics GR)
  20. super.paintComponent(gr);
  21. gr.setColor(Color.BLUE)
  22. gr.fillRect(10,10,200,300);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement