View Single Post
Old 05-16-2005, 01:23 AM   #1 (permalink)
Albeeezz
Registered User
 
Join Date: May 2005
Posts: 5
Albeeezz is on a distinguished road
squeeze JPanel horizontally to fit JScrollPane

Hello, I am a beginner using Java and I have some questions in regard to JScrollPane.


I have a JPanel which contains many JTextField's in a single row.

I have placed the JPanel inside a JScrollPane.

I have disabled horizontal scrolling and set vertical scrolling "as needed."

How can I force the JPanel to resize its width to never exceed the width of the JScrollpane to eliminate the need for horizontal scrolling ?

I only want it to exceed vertically if needed so the user may scroll down.

I have tried the JPanel.setSize(); method but it has no effect.


Any help will be greatly appreciated, thank you
Albeeezz is offline   Reply With Quote