Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: James Rivera   on Jan 08 In Java Category.

  
Question Answered By: Frederick Greene   on Jan 08

To compile  :
javac MyFrame.java

To run:
java MyFrame

Few things must be fixed in order to make it work.

1. add(String, Component) method is obsolete.
change it to add(Component)
2. add main method:

public static void  main(String[] args) {
MyFrame f = new MyFrame();
f.setDefaultCloseOperation(JFRAME.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
}

Share: 

 

This Question has 10 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on JFC / Swing Or get search suggestion and latest updates.


Tagged: