• 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

Swing is my Nemesis

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to add more than one JOptionPane to a dialog?
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We do have a forum specifically devoted to Swing and AWT. I am going to move this to that forum, where you will get a better response.
 
Vanessa Astle
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!!
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vanessa,

I'm not sure what you are asking. The JOptionPane class is usually used to create a dialog. Do you mean is is possible to display more than one at a time?
What exactly are you wanting to accomplish?

Darrin
 
Vanessa Astle
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to create a popup where a user has to choose options from a few different fields.

According to "The Definitive Guide to Java Swing" and the numerous other textbooks on swing that I have piled around me, a JOptionPane is "a special class for creating a panel to be placed in a pop-up window". And a Dialog is "a class that represents the standard pop-up window". Yet, in Java JOptionPane's seem sort of interchangeable with dialogs. I am being told that I can place a JOptionPane "in" a JDialog or JInternal Frame by making a reference of those types and assigning them to the JOptionPane object.

I just wanted an easier way to make a popup. I really didn't want to have to deal with layouts, and the JOptionPane class seemed like an ideal way to get a readymade panel, insert it into some sort of frame/dialog popup, and go from there!

Any insight would be fabulous! Thanks so much!
 
Darrin Cartwright
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Creating a custom JOptionPane to insert into a JDialog will probably be more trouble than just creating a JDialog to begin with. You will also be limited by the return values possible, although an array of String is always useful.

Darrin
 
Vanessa Astle
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alright, I decided to use the GridBagLayout class and it helped me out with the layout quite a bit. Thanks for your help!
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic