This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Scrolling with JDialog" Watch "Scrolling with JDialog" New topic

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?
Rob Spoor

Joined: Oct 27, 2005
Posts: 19911

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.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Scrolling with JDialog