Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / May 2005

Tip: Looking for answers? Try searching our database.

Adding Scrollbars to a canvas

Thread view: 
Frank Meyer - 28 May 2005 08:38 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.