View Single Post
Old 05-16-2005, 02:21 AM   #2 (permalink)
Albeeezz
Registered User
 
Join Date: May 2005
Posts: 5
Albeeezz is on a distinguished road
For example,

when you add a JPanel with plenty of JLabel's and JTextField's in a single row to a JFrame, the JPanel will automatically resize its width to fit in the JFrame and make the JLabels and JTextField's shorter.

When you add a JPanel like this to a JScrollPane, it does not resize itself at all and requires you to scroll horizontally.

I have tried the JPanel.setSize() method to manually set the width but to no effect.

I have tried the JScrollPane.setHorizontalScrollBarPolicy(); method
and set it to:
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER,

thinking that the JPanel will automatically resize its width but also to no effect.

I would only like the JPanel to exceed the JScrollPane vertically and sqeeze its width to fit horizontally so i dont need a horizontal scrollbar, only a vertical.

Is there anyone here that can please help me?
Albeeezz is offline   Reply With Quote