0

I would like to load the form DataEntry from the main class.. I'm a newbie to Java, any help would be appreciated.

public class Main extends javax.swing.JFrame{

  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) {
    DataEntry dbJframe = new DataEntry();
    DbConnect connect = new DbConnect();
    connect.getData();
m59
  • 42,346
  • 14
  • 112
  • 132
Nasir Shiraz
  • 161
  • 1
  • 3
  • 15
  • 1
    1) *"..form DataEntry"* What `DataEntry` form? For better help sooner, post an [SSCCE](http://sscce.org/). 2) Please *read* the helpful tag pop-ups before slapping them on your question. This has ***nothing*** to do with HTML forms. – Andrew Thompson Dec 13 '13 at 18:54
  • DataEntry is a Jframe form , i basically want it to load from Main class. thanks – Nasir Shiraz Dec 13 '13 at 18:56
  • *"DataEntry is a Jframe form"* 1) Again, a little louder this time.. ***For better help sooner, post an [SSCCE](http://sscce.org/).*** 2) See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/a/9554657/418556) The 2nd 'frame' should probably be a `JDialog`. – Andrew Thompson Dec 13 '13 at 18:57

1 Answers1

1

Try calling

dbJframe.setVisible(true);

Seems that's what you need.

peter.petrov
  • 36,377
  • 12
  • 75
  • 137
  • @NasirShiraz: After a time, you can accept this answer by clicking on the [empty check mark](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235) at the left. See also [*Initial Threads*](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/initial.html). – trashgod Dec 14 '13 at 01:18