I have tried running a small gui program first time in my system. When i compiled the program in command prompt there was no error . But when i run the program it is not displaying the application instead the text file where i have written the program is being opened.I am using command prompt to run the program. I installed java from oracle.com and followed all procedures. Also i can get output for normal java programs.Please give me a solution why i dont get the result in command prompt
This is my program:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Frame1 extends JFrame {
JPanel pane = new JPanel();
Frame1() // the frame constructor method {
super("My Simple Frame");
setBounds(100,100,300,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container con = this.getContentPane(); // inherit main frame
con.add(pane); // add the panel to frame
// customize panel here
// pane.add(someWidget);
setVisible(true); // display this frame
}
public static void main(String args[]) {
new Frame1();
}
}