J Frame Created in Java
J Frame Created in Java
Let's see a simple swing example where we are creating JFrame object inside the main() method.
J Frame Create Code :
import javax.swing.JFrame;
public class FrameDemo extends JFrame {
public static void main(String[] args) {
FrameDemo frame =new FrameDemo();
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(200, 50, 400, 300);
frame.setTitle("Frame Demo");
frame.setResizable(false);
}
}
Output :-
No comments