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.
SCJP 1.4 SCJD
posted 10 years ago
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.
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF