This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Need a Property Sheet with Apply/OK/Cancel: is this the recommended way? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Need a Property Sheet with Apply/OK/Cancel: is this the recommended way?" Watch "Need a Property Sheet with Apply/OK/Cancel: is this the recommended way?" New topic
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
    
    2

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
    
    3

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Need a Property Sheet with Apply/OK/Cancel: is this the recommended way?
 
Similar Threads
Accessing Registry
Simple Accept / Reject Dialog refuses to work
Which JButton is being pressed ? OK or Cancel ?
POPUP
how do i pass some time?