| Author |
Need a Property Sheet with Apply/OK/Cancel: is this the recommended way?
|
Steve Stevenson
Greenhorn
Joined: Apr 12, 2012
Posts: 21
|
|
When I was using Visual C++ & MFC, there was a special window for property sheets that displayed a tabbed UI with a series of buttons on the bottom labeled "OK", "Cancel", and "Apply". From what I can tell, Swing does not have such a class. The closest I've been able to find is JTabbedPane, but it does not contain the trio of buttons I mentioned. While I can certainly use the JTabbedPane and create my own code to handle those buttons, I'm just curious if Java already has something for this type of window that I just haven't stumbled across.
I'm not looking for a 3rd party library. I just want to know if Java itself (I guess through Swing) has already invented this wheel so that I don't go about reinventing it. I'm trying to learn this language and want to make sure I use as much of the real & standardized stuff as possible. Basically since I'm learning I want to make sure I do something right even if my own personal detour works.
EDIT: I don't really need any source code: I'm just looking for a pointer to point me in the established direction on how these are typically made in Java.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
I don't think that Swing has a component with exactly that combination of buttons, but I think that you should be looking at JDialog and JOptionPane rather than JTabbedPane. Check out the tutorial How to Make Dialogs for much better information than what I've got.
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4167
|
|
You can pass a JTabbedPane (or any other component, or even an array of components [which will be stacked vertically]) as the message argument to a JOptionPane static show...Dialog method.
Edit And you can either use the YES_NO_CANCEL_OPTION and customize the button texts, or use an appropriate form of showOptionDialog(..) to get the three buttons you need.
|
luck, db
There are no new questions, but there may be new answers.
|
 |
Steve Stevenson
Greenhorn
Joined: Apr 12, 2012
Posts: 21
|
|
|
Excellent! I will check out those leads and come up with something to create that property sheet.
|
 |
 |
|
|
subject: Need a Property Sheet with Apply/OK/Cancel: is this the recommended way?
|
|
|