Buggy code:
public class ExportDialog extends JDialog implements ActionListener , TreeSelectionListener { private static final String RESOURCE_PATH = "org.columba.core.i18n.dialog" ; JButton exportButton ; JButton selectAllButton ; JButton helpButton ; JButton closeButton ; JTree tree ; Map map ; protected DefaultMutableTreeNode selectedNode ; public ExportDialog ( ) { } protected void initComponents ( ) { JPanel mainPanel = new JPanel ( ) ; mainPanel . setLayout ( new BorderLayout ( ) ) ; mainPanel . setBorder ( BorderFactory . createEmptyBorder ( 12 , 12 , 12 , 12 ) ) ; getContentPane ( ) . add ( mainPanel ) ; exportButton = new JButton ( "Export..." ) ; exportButton . setActionCommand ( "EXPORT" ) ; exportButton . addActionListener ( this ) ; selectAllButton = new JButton ( "Select<seq2seq4repair_space>All" ) ; selectAllButton . setActionCommand ( "SELECTALL" ) ; selectAllButton . addActionListener ( this ) ; tree = new JTree ( MainInterface . treeModel ) ; tree . setRootVisible ( false ) ; tree . setCellRenderer ( new CheckRenderer ( map ) ) ; tree . getSelectionModel ( ) . setSelectionMode ( TreeSelectionModel . SINGLE_TREE_SELECTION ) ; tree . addMouseListener ( new ExportDialog . NodeSelectionListener ( tree ) ) ; tree . expandRow ( 0 ) ; tree . expandRow ( 1 ) ; tree . addTreeSelectionListener ( this ) ; JPanel topPanel = new JPanel ( ) ; topPanel . setLayout ( new BoxLayout ( topPanel , BoxLayout . X_AXIS ) ) ; GridBagLayout gridBagLayout = new GridBagLayout ( ) ; GridBagConstraints c = new GridBagConstraints ( ) ; JPanel topBorderPanel = new JPanel ( ) ; topBorderPanel . setLayout ( new BorderLayout ( ) ) ; topBorderPanel . add ( topPanel ) ; JLabel nameLabel = new JLabel ( "name" ) ; nameLabel . setEnabled ( false ) ; topPanel . add ( nameLabel ) ; topPanel . add ( Box . createRigidArea ( new Dimension ( 10 , 0 ) ) ) ; topPanel . add ( Box . createHorizontalGlue ( ) ) ; Component glue = Box . createVerticalGlue ( ) ; c . anchor = GridBagConstraints . EAST ; c . gridwidth = GridBagConstraints . REMAINDER ; gridBagLayout . setConstraints ( glue , c ) ; gridBagLayout = new GridBagLayout ( ) ; c = new GridBagConstraints ( ) ; JPanel eastPanel = new JPanel ( gridBagLayout ) ; mainPanel . add ( eastPanel , BorderLayout . EAST ) ; c . fill = GridBagConstraints . HORIZONTAL ; c . weightx = 1.0 ; c . gridwidth = GridBagConstraints . REMAINDER ; gridBagLayout . setConstraints ( exportButton , c ) ; eastPanel . add ( exportButton ) ; Component strut1 = Box . createRigidArea ( new Dimension ( 30 , 5 ) ) ; gridBagLayout . setConstraints ( strut1 , c ) ; eastPanel . add ( strut1 ) ; gridBagLayout . setConstraints ( selectAllButton , c ) ; eastPanel . add ( selectAllButton ) ; glue = Box . createVerticalGlue ( ) ; c . fill = GridBagConstraints . BOTH ; c . weighty = 1.0 ; gridBagLayout . setConstraints ( glue , c ) ; eastPanel . add ( glue ) ; JPanel centerPanel = new JPanel ( new BorderLayout ( ) ) ; centerPanel . setBorder ( BorderFactory . createEmptyBorder ( 0 , 0 , 0 , 5 ) ) ; JScrollPane scrollPane = new JScrollPane ( tree ) ; <START_BUG> scrollPane . setPreferredSize ( new Dimension ( 450 , 300 ) ) ; <END_BUG> scrollPane . getViewport ( ) . setBackground ( Color . white ) ; centerPanel . add ( scrollPane ) ; mainPanel . add ( centerPanel ) ; JPanel bottomPanel = new JPanel ( new BorderLayout ( ) ) ; bottomPanel . setBorder ( new SingleSideEtchedBorder ( SwingConstants . TOP ) ) ; JPanel buttonPanel = new JPanel ( new GridLayout ( 1 , 3 , 6 , 0 ) ) ; buttonPanel . setBorder ( BorderFactory . createEmptyBorder ( 12 , 12 , 12 , 12 ) ) ; ButtonWithMnemonic closeButton = new ButtonWithMnemonic ( MailResourceLoader . getString ( "global" , "close" ) ) ; closeButton . setActionCommand ( "CLOSE" ) ; closeButton . addActionListener ( this ) ; buttonPanel . add ( closeButton ) ; ButtonWithMnemonic helpButton = new ButtonWithMnemonic ( MailResourceLoader . getString ( "global" , "help" ) ) ; helpButton . setActionCommand ( "HELP" ) ; helpButton . addActionListener ( this ) ; buttonPanel . add ( helpButton ) ; bottomPanel . add ( buttonPanel , BorderLayout . EAST ) ; getContentPane ( ) . add ( bottomPanel , BorderLayout . SOUTH ) ; getRootPane ( ) . setDefaultButton ( closeButton ) ; getRootPane ( ) . registerKeyboardAction ( this , "CLOSE" , KeyStroke . getKeyStroke ( KeyEvent . VK_ESCAPE , 0 ) , JComponent . WHEN_IN_FOCUSED_WINDOW ) ; getRootPane ( ) . registerKeyboardAction ( this , "HELP" , KeyStroke . getKeyStroke ( KeyEvent . VK_F1 , 0 ) , JComponent . WHEN_IN_FOCUSED_WINDOW ) ; } class NodeSelectionListener extends MouseAdapter { JTree tree ; NodeSelectionListener ( JTree tree ) { } public void mouseClicked ( MouseEvent e ) { } } public void actionPerformed ( ActionEvent e ) { } public void valueChanged ( TreeSelectionEvent arg0 ) { } public DefaultMutableTreeNode getSelectedNode ( ) { } }

Fix:
scrollPane . setPreferredSize ( new Dimension ( 300 , 300 ) ) ;