Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Dimension;
- import java.awt.Graphics;
- import java.awt.GridLayout;
- @SuppressWarnings("serial")
- public class GraphicsTile extends JPanel {
- public static final Dimension SIZE = new Dimension(140, 140);
- public static final GridLayout MGR = new GridLayout(2, 2);
- public GraphicsTile() {
- super();
- setLayout(MGR);
- add(new CirclePanel());
- add(new CirclePanel());
- add(new CirclePanel());
- add(new CirclePanel());
- }
- @Override
- public Dimension getPreferredSize() {
- return SIZE;
- }
- @Override
- protected void paintComponent(Graphics g) {
- super.paintComponent(g);
- g.setColor(Color.GREEN);
- g.fillRect(0, 0, 140, 140);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement