• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pop out a dialogBox?Help me please.  RSS feed

 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • 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.
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!