Tuesday, July 28, 2020

Create a Frame

A frame is a window for your application. It is the basic part and ground where your Swing application lives.

 import javax.swing.JFrame;

  public class Frame {
    public static void main(String[] args) {
      JFrame frame = new JFrame();
      frame.setSize(400,400);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setVisible(true);
    }
  }

No comments:

Post a Comment

Ever feel like no one is listening?

 Ever have that feeling that no one is listening to you? Yeah, that feeling. It can be a strong feeling to have, a hurtful feeling also. The...