This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding a JDialog to JOptionPane  RSS feed

 
Naren Guru
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way by which one can add a JDialog to a JContentPane, wherein u get the dual advantage of the icon provided in the JOptionPane and along with that of ones own JDialog with a predetermined arrangement of components.
Also what is the Layout of a JOptionPane?
Thnx in advance,
reg,
Narendran_gurubaran.
 
Greg Charles
Sheriff
Posts: 3014
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The purpose JOptionPane is to ease the creation of certain standard dialogs: message boxes, action confirmations, simple input, etc. There's quite a variety of dialogs you can create using it, but obviously you can't do everything. You can't add a JDialog to it, or in fact any component, at least not directly. If you need to go beyond the abilites of JOptionPane, just use JDialog itself.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Swing forum.
 
Ashish Mahajan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Naren,
U want JOpitionPane's icons plus (i guess) Yes-No-Cancel buttons, Right??. I think u just wanna customize the center display area.
Then perhaps taking a look at OptionPane demo section of SwingSet ("Show Component Dialog") will help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!