Placing JComponent inside a JScrollPane

From Catglobe Wiki
Revision as of 09:50, 11 November 2009 by Catglobe (talk | contribs) (Created page with 'Add Your Content Here category:Technical guidelines =Introduction= You have some component in a scroll pane and when its preferred height is less than the scollpane area …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Add Your Content Here

Introduction

You have some component in a scroll pane and when its preferred height is less than the scollpane area then you want it to stretch to fill the scollpane. But when it grows bigger than the scollpane area you would like it show the scrollbars. This is very useful when you want to be able to click in the spare space to clear selection or in the case of drag and drop where you want to be able to drop into the empty area. From JDK 6, in order to do this, simply use function [code language="java"] this.setFillsViewportHeight(true); [/code] But back to JDK 5, you must implement it by your self.

Our problem

Recently, we have some client using MAC PC. MAC OS only supports JDK 5. That's the reason why the supported function i mentioned above can't be use. It leads to our GUI for question properties dialog broken
[img File:MAC_bug.png][/img]