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 javax.swing.JFrame;
- import javax.swing.JPanel;
- public class Demo {
- public static void main(String[] args) {
- JFrame f = new JFrame("Demo");
- f.setSize(new Dimension(500, 500));
- JPanel p = new JPanel() {
- private static final long serialVersionUID = 1L;
- @Override
- public void paintComponent(Graphics g) {
- g.setColor(Color.BLACK);
- g.drawLine(125, 0, 125, 80);
- g.drawLine(250, 0, 250, 80);
- g.drawLine(375, 0, 375, 80);
- g.drawLine(0, 80, 500, 80);
- }
- };
- f.add(p);
- f.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement