aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Scrolling with JDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Scrolling with JDialog" Watch "Scrolling with JDialog" New topic
Author

Scrolling with JDialog

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Hi there. I have a JDialog that has quite a few components in it. Depending on what the user chooses in the first JComboBox, certain components below that are made visible. The problem I am running into, is there are some users who have their resolution set pretty low... so when they choose a selection that makes all components visible on the JDialog, it resizes to accommodate the components, and then goes off of the screen, and they are unable to access the JButtons at the bottom. I was contemplating putting a JScrollPane in the JDialog, but I didn't think that would work because I already resized the dialog, so the scroll bar wouldn't ever appear. Any ideas?
Thanks!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

Use GraphicsEnvironment.getMaximumWindowBounds() to get the desktop size (i.e. without the task bar etc), then set the size as the minimum of the desired size and this size.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: Scrolling with JDialog