Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.*;
- // Creating panel for grid
- public class GridPanel extends JPanel
- {
- protected void paintComponent(Graphics g)
- {
- super.paintComponent(g);
- for(int i = 1; i <=2; i++)
- {
- g.setColor(Color.BLUE);
- g.drawLine(0, i * (getHeight() / 3), getWidth(), i * (getHeight() / 3));
- g.setColor(Color.RED);
- g.drawLine(i * (getWidth() / 3), 0, i * (getWidth() / 3), getHeight());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment