Custom input from user

I'd like to program a dialog box which I can customise so i can have a text box for input, a combo box, and a few buttons.

What is the best component to use for this purpose? I'm confused and not sure whether i can do this using a JDialog, JOptionPane, or JInternalFrame.

Any help will be much appreciated.

Thanks.

[342 byte] By [faraz4evera] at [2007-10-2 10:22:30]
# 1

If you use a JDialog then you would need to build all the components and respond all the events from the buttons.

If you use a JOptionPane then you could build a panel containing you components, without the "Ok", and "Cancel" buttons and the JOptionPane would handle this for you. Read the [url http://java.sun.com/developer/JDCTechTips/]Beyond the Basics of JOptionPane[/url] for more information.

You would not use a JInternalFrame for this situation.

camickra at 2007-7-13 1:54:36 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks a lot for your advice, I'll have a look at the link and get back to you if i have any further questions.Thanks again.
faraz4evera at 2007-7-13 1:54:36 > top of Java-index,Desktop,Core GUI APIs...
# 3
Could someone post a small example because I still don't understand how to do this.Thanks.
faraz4evera at 2007-7-13 1:54:36 > top of Java-index,Desktop,Core GUI APIs...
# 4
Maybe you should take a look at [url http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html]How to Make Dialogs[/url]. It's got plenty of example code.: jay
JayDSa at 2007-7-13 1:54:36 > top of Java-index,Desktop,Core GUI APIs...