How to add JScrollBar for Canvas?

101 Views Asked by At

I have done MyCanvas class which extends GCanvas class, now I want to use and add this canvas another program, I have done this, but now I want to add scrollbar for canvas and I have no idea how to do it, I have read some examples but it was difficult to understand, I would be grateful if someone will tell me :) ( I use java)

1

There are 1 best solutions below

3
On

Have you tried JScrollPane scroll = new JScrollPane(MyCanvas);?