• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Two GUIs in one class using netbeans builder

 
Ranch Hand
Posts: 74
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 79239
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic