Saturday, April 7, 2018
Creating and setting up JFrame
System 1:
package scm;
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(100, 50, 400, 300);
frame.setTitle("Frame Demo");
frame.setResizable(false);
}
}
System 2:
package scm;
import javax.swing.JFrame;
public class FrameDemo extends JFrame {
FrameDemo(){
initComponents();
}
private void initComponents() {
}
public static void main (String[]args) {
FrameDemo frame = new FrameDemo () ;
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
frame.setBounds(100, 50, 400, 300);
frame.setTitle("Frame Demo");
frame.setResizable(false);
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment