• 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

How to pop out a dialogBox?Help me please.

 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers,

One of my JMenuItem will going to addActionListenr to pop out a dialogBox. In that dialogBox there should be a CheckBox, several input TextArea and a "check" Button. Can JOptionPane take charge of my requirement? So far as I know there are only one TextArea in the dialogBox poped out by JOptionPane, are there another class better suit my case than JOptionPane? Lots of thanks.
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can always add your components to a JDialog and show it from your action listener event code.
If you want to use a JOptionPane you can assemble your components on a JPanel, add the desired listeners (to get the information from the components) and add the JPanel to the JOptionPane as the Object message. Another option is to mount your JOptionPane in a dialog as shown in the "Direct Use" section which is at the end of the discussion section in the JOptionPane api.
 
and POOF! You're gone! But look, this tiny ad is still here:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic