Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JComponent;
- import java.awt.Color;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.geom.Ellipse2D;
- public class ThreeButtonComponent extends JComponent
- {
- public void paintComponent(Graphics g)
- {
- Graphics2D g2 = (Graphics2D) g;
- g2.setColor(Color.GRAY);
- g2.fill3DRect(50, 50, 50, 50, true);
- g2.fill3DRect(110, 50, 50, 50, true);
- g2.fill3DRect(170, 50, 50, 50, true);
- g2.setColor(Color.RED);
- g2.fillOval(60, 60, 30, 30);
- g2.setColor(Color.GREEN);
- g2.fillOval(120, 60, 30, 30);
- g2.setColor(Color.cyan);
- g2.fillOval(180, 60, 30, 30);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment