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)
Asked
Active
Viewed 89 times
1 Answers
3
Have you tried JScrollPane scroll = new JScrollPane(MyCanvas);
?

Sergi
- 579
- 3
- 14
-
NO, but what can I do then? – user3123521 Dec 20 '13 at 17:07
-
Add this line in the constructor of the component that has the JScrollPane. – Sergi Dec 20 '13 at 17:09
-
Check [this link](http://stackoverflow.com/questions/9393480/java-jpanel-inside-jscrollpane). – Sergi Dec 20 '13 at 17:19