aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Minimize and Maximize button in JDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Minimize and Maximize button in JDialog" Watch "Minimize and Maximize button in JDialog" New topic
Author

Minimize and Maximize button in JDialog

chithra rasavelu
Greenhorn

Joined: Jul 06, 2012
Posts: 2
Hi,

I need to add minimize and maximize button in the titlebar of JDialog. Is there a way to do this?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
where are you going to minimize it to?
chithra rasavelu
Greenhorn

Joined: Jul 06, 2012
Posts: 2
I want to minimize it to the parent window which is a frame.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
so, it's going to sit as a tiny icon, somewhere on the frame?
then click the icon to restore?

if that's what you're trying, one way might be:
set the dialog as undecorated,
build your own titleBar, adding min/max(restore)/X buttons
add the titleBar at borderLayout.NORTH of the dialog
add a motionListener to the titlebar, so the dialog can be dragged to a new location
add a border to the dialog
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1085
    
  10

I think what you actually need is JDesktopPane and JInternalFrame.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
 
jQuery in Action, 2nd edition
 
subject: Minimize and Maximize button in JDialog