How do I get scrollbars in the main JFrame when the size of a JInternalFrame becomes greater than that of the main JFrame?

Sandip Chitale

Add the JDesktopPane containing the JInternalFrames to a JScrollPane.

Make sure that the preferredSize of the JDesktopPane is at least equal to the rectangle enclosing all the JInternalFrames (for that you will have to listen to events (on JInternalFrames) using to ComponentListener and recompute new size of JDesktopPane in the componentResized and componentMoved callbacks). After adjusting the size of JDesktopPane call revalidate() on it.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact