Forums Register Login

Scroll Bars

+Pie Number of slices to send: Send
Hello there,
Have a JTree which is the client for a JScrollPane. The JScrollPane is added to a panel which is a part of an applet. What does it take to get scroll bar as needed to to the scroll pane.
Have already set the ScrollBar policies as
scrollPane = new JScrollPane(tree);
scrollPane.setVerticalScrollBarPolicy (JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setHorizontalScrollBarPolicy (JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setPreferredSize(new Dimension (650,400));
this.add(scrollPane);
Thanks
Jack
+Pie Number of slices to send: Send
I think, you don't need to set the policies.
It is enough to create an empty JScrollPane.

If this doesn't work, please give a bit more code, but leave it simple.
+Pie Number of slices to send: Send
thanks mate it works
regards
jack
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 727 times.
Similar Threads
No Scroll Bar coming in JTextArea
ScrollBar(VERY URGENT PLEASE)
JScrollpane Action Listener
JTextArea on JScrollPane
JTextArea
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:26:23.