How to make Canvas on a JSCrollPane Vertical/Horizontal splittable

I have a JScrollPane on which i placed a JTree(Vertical/Horizontal Scrollable)

I have a ScrollPane on which i placed a Canvas(Vertical/Horizontal Scrollable)

I was able to do it but, its splitting towards the JScrollPane area only.

So i tried to make a JScrollPane and tried to add a Canvas to it setting the options as JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS.

But the problem is its showing the Scrollable bars but not able to Scroll when more images are there on the Canvas.

My problem will be solved if i was able to add a Canvas to the JScrollPane with Vertical/Horizontal Scrollable.

[664 byte] By [naveen9a] at [2007-10-3 3:00:46]
# 1

Don't mix Swing and AWT components. Don't use a Canvas. Use a JPanel instead.

If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.

camickra at 2007-7-14 20:50:23 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks for the replyBut i didnt get the exact solution.I want to display thumbnails, so i have used Canvas on the JScrollPane.Is there any other way to achieve this.If so reply ASAP.
naveen9a at 2007-7-14 20:50:23 > top of Java-index,Desktop,Core GUI APIs...
# 3
Read the first line of my reply ASAP.If that doesn't help then read the rest of my reply ASAP.
camickra at 2007-7-14 20:50:23 > top of Java-index,Desktop,Core GUI APIs...
# 4
I have no idea how to display thumbnails on a JPanel.And that too iwant it to be horizontal/vertical scrollable as needed.If you could help me in giving the sample code for the same, i will be thankful
naveen9a at 2007-7-14 20:50:23 > top of Java-index,Desktop,Core GUI APIs...
# 5
> I have no idea how to display thumbnails on a JPanelThe same way you do on a Canvas.
camickra at 2007-7-14 20:50:23 > top of Java-index,Desktop,Core GUI APIs...