advictoriam

Untitled

Nov 20th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. import javax.swing.JComponent;
  2. import java.awt.Color;
  3. import java.awt.Graphics;
  4. import java.awt.Graphics2D;
  5. import java.awt.geom.Ellipse2D;
  6.  
  7. public class ThreeButtonComponent extends JComponent
  8. {
  9.    public void paintComponent(Graphics g)
  10.    {
  11.       Graphics2D g2 = (Graphics2D) g;
  12.       g2.setColor(Color.GRAY);
  13.       g2.fill3DRect(50, 50, 50, 50, true);
  14.       g2.fill3DRect(110, 50, 50, 50, true);
  15.       g2.fill3DRect(170, 50, 50, 50, true);
  16.       g2.setColor(Color.RED);
  17.       g2.fillOval(60, 60, 30, 30);
  18.       g2.setColor(Color.GREEN);
  19.       g2.fillOval(120, 60, 30, 30);
  20.       g2.setColor(Color.cyan);
  21.       g2.fillOval(180, 60, 30, 30);
  22.      
  23.    }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment