This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two GUIs in one class using netbeans builder

 
Ciaran Mooney
Ranch Hand
Posts: 74
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am creating a database app using netbeans GUI form builder to display a JTable with DB contents.
When the user wants to add to the DB i want to get input from a separate GUI by the click of a button.
Does anyone no if it is possible to create another JFrame dialog GUI in the same class as the main GUI in netbeans GUI builder?
Thanks
Ciaran
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure whether you really mean “same class”.
Sounds as though you want a dialog to appear. That is not difficult.
 
Ciaran Mooney
Ranch Hand
Posts: 74
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wat i am looking for is something more rubust that can take allot more input fields than a JOptionpane.
So i need another separate GUI called from within the same class as my primary GUI when the 'Add Person' button is selected. So i am wondering is it possible to create two GUIs in one netbeans builder class or maybe i need to create a seperate class with 'get' compent methods to facilitate listening from another class.... Or create a i internal frame..
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whether NetBeans or not, you should look to create 2 GUIs in 2 different classes. You can then call one class from other by creating its instance.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ciaran Mooney wrote: . . . more input fields than a JOptionpane. . . .
You can have much more input than you see in the tutorials, even on an option pane dialogue. The Java Tutorials gives you only a simple start on dialogues.
 
Ciaran Mooney
Ranch Hand
Posts: 74
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
I got what i needed by creating a array of JConponments (labels and text fields ) and adding this to a JOptionpane.
I didnt realise the JOptpane could take JPanels and jcomponents as arguments and also a JDialog is another top level container like JFrame.
I no i cant add one top level container to another but is there a limit to the number in one class?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic