2

I'm using Swing for the first time and I've a problem with the JScrollPane...

I've this structure

JPanel west

ScrollPane scrollPane

JList list

"west" contains "scrollPane". "scrollPane" contains "list"

the "west" 's LayoutManager is a BorderLayout, now I want that the JScrollPane has a fixed width but the height adapts itself with the height of "west"...

Is there a solution?

Sorry for my poor english, but I'm not english and I'm very very sleepy :)

davidinho
  • 169
  • 1
  • 14
  • see setPreferredSize() - http://stackoverflow.com/a/9394139/763029 – Caffeinated Mar 19 '13 at 00:55
  • Try setMaximumSize() and set the width to what you want and the height to the screen height. – Paulo Pedroso Mar 19 '13 at 01:10
  • I'm tryed using setMaximumSize(), but the scrollPane remains at the minimum size Using setPrefferedSize() I can set both width and height together, but not only the width... I'm missing something? – davidinho Mar 19 '13 at 21:02

0 Answers0