 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Frank Meyer Guest
|
Posted: Sat May 28, 2005 7:38 am Post subject: Adding Scrollbars to a canvas |
|
|
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
|
|
| Back to top |
|
 |
Tor Iver Wilhelmsen Guest
|
Posted: Sat May 28, 2005 9:52 am Post subject: Re: Adding Scrollbars to a canvas |
|
|
"Frank Meyer" <f.meyer (AT) 1und1 (DOT) de> writes:
| Quote: | 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.
|
|
| Back to top |
|
 |
Frank Meyer Guest
|
Posted: Sat May 28, 2005 12:12 pm Post subject: Re: Adding Scrollbars to a canvas |
|
|
Tor Iver,
| Quote: | 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
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|