Hi newsgroup,
I hope this is one of my last questions, but nevertheless I'm still in
trouble with my project:
I created a canvas whre some objects are drawn. Now it could be possible
that the width of this canvas is too large for the screen width so I would
need horizontal scrollbars to be able to scroll to the end of the canvas. My
canvas class extends the JPanel object so maybe I have to use JScrollPane(?)
Now I tried to use ScrollBar directly, as well as reading the API about the
JScrollPane but I'm still confused about how to use...
Once again, thanks very much in advance for any help.
With best regards
Frank
Tor Iver Wilhelmsen - 28 May 2005 10:38 GMT
> I created a canvas whre some objects are drawn. Now it could be possible
> that the width of this canvas is too large for the screen width so I would
> need horizontal scrollbars to be able to scroll to the end of the canvas. My
> canvas class extends the JPanel object so maybe I have to use JScrollPane(?)
You should put the canvas into the viewport of a JScrollPane and let
that object do what it does best.
Frank Meyer - 28 May 2005 13:12 GMT
Tor Iver,
> You should put the canvas into the viewport of a JScrollPane and let
> that object do what it does best.
Thanks, I'll try that.
Best
Frank