Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1.  protected void paint(Graphics g) {
  2.         g.setColor(255, 255, 255);
  3.         g.fillRect(0, 0, this.getWidth(), this.getHeight());
  4.        
  5.         //górny blue
  6.         g.setColor(0, 0, 255);
  7.         g.drawArc(60, 50, 50, 50,0, 360);
  8.        
  9.         // górny czarny
  10.         g.setColor(0, 0, 0);
  11.         g.drawArc(96, 50, 50, 50, 0, 360);
  12.        
  13.         //górny czerwony
  14.         g.setColor(255, 0, 0);
  15.         g.drawArc(132, 50, 50, 50, 0, 360);
  16.        
  17.         //dolny żółty
  18.         g.setColor(255, 255, 0);
  19.         g.drawArc(78, 70, 50, 50, 0, 360);
  20.        
  21.         //dolny zielony        
  22.         g.setColor(0, 255, 0);      
  23.         g.drawArc(114, 70, 50, 50, 0, 360);
  24.        
  25.        
  26.         g.setColor(0, 0, 255);
  27.         g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_MEDIUM));
  28.         g.drawString(napis, this.getWidth() / 2, this.getHeight() / 2, Graphics.BASELINE | Graphics.HCENTER);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement