JScrollPane problem

Hi...

I have a huge JPanel (with BorderLayout) and I want o put it into a JScrollPane to put it into a JSplitPane.

I have created the JScrollPane and I've added my JPanel to the ScrollPane. However, when I show it, it appears empty. If I dont use a ScrollPane (insert the huge JPanel without the ScrollPane), It appears ok.

can you help me find the problem?

Message was edited by:

Leo77

Message was edited by:

Leo77

[467 byte] By [Leo77a] at [2007-11-27 4:28:53]
# 1
it's hard to say without seeing any code...just a thought.... have u set the ViewPortView of the scrollPane to the jpanel?scrollPane.setViewportView(jpanel);
izziieea at 2007-7-12 9:37:45 > top of Java-index,Desktop,Core GUI APIs...
# 2
You must never add a component directly to the JScrollPane. Try either to use the JScrollPane(Component) constructor, or the setViewportView method. It could help if you send a few more details...
sztyopeka at 2007-7-12 9:37:45 > top of Java-index,Desktop,Core GUI APIs...
# 3
Did you read the tutorial? http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html
Rodney_McKaya at 2007-7-12 9:37:45 > top of Java-index,Desktop,Core GUI APIs...
# 4
ThanksI've solved with scrollPane.setViewportView(jpanel);I should do this instead of add the Panel to the scrollPane
Leo77a at 2007-7-12 9:37:45 > top of Java-index,Desktop,Core GUI APIs...