Is this your first time here? SwingWiki is a Java Swing Developer community site with an big archive of Swing-related usenet groups and mailing lists, but also tips, tricks and articles and book reviews written by your colleagues from around the world. If you came here through a search engine and did not find what you were looking for, make sure to check the wiki table of contents.

Avoid Double Scrolling

Avoid putting components with scroll bars inside another JScrollPane, though this can be hard in a complex GUI, especially because some objects, like JTables, require to be put inside JScrollPanes (see Missing JTable Header). With automatic layout management, if you put into a JScrollPane a container that already contains a JScrollPane, you will get unexpected results in the inner pane .

If you are creating a GUI builder or script engine, add a simple method like ‘isInScrollPane’' to a general container class (like a sub-classed JPanel), and use it to decide whether to enclose it in the scroll pane or not.


Comments? Corrections? Contact us or Login to edit pages directly (registration is free and takes less than displaying a JLabel)
  best/avoid_double_scroll.txt · Last modified: 2005/02/14 10:50
Recent changes | RSS changes | Table of contents | News Archive | Terms And Conditions | Register | The Quest For Software++| Ruby Resources

Sedo - Buy and Sell Domain Names and Websites project info: Statistics for project etracker� web controlling instead of log file analysis