• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Swing is my Nemesis

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to add more than one JOptionPane to a dialog?
 
lowercase baba
Posts: 12871
62
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks!!
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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!
 
    Bookmark Topic Watch Topic
  • New Topic