Meaningless Drivel is fun!*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
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: 19651
    
  18

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scrolling with JDialog
 
Similar Threads
coding a texteditor: want to open a separate option window
how to disable resize
JPanel only displays one component
How to make a popup Window, not Menu
Adding ScrollBar to JTextArea