How to create a frame using java swing:
This program shows you how to create a frame in Java Swing
Application. The frame
in java
works like the main window where your components (controls) are added to
develop an application. In the Java Swing, top-level windows are represented by
the JFrame class.
Example program:
import javax.swing.*;
public class Swing_Create_Frame
{
public static void main(String[] args)
{
JFrame frame = new JFrame("Frame in Java Swing");
frame.setSize(400, 400);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
No comments:
Post a Comment