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 / February 2005

Tip: Looking for answers? Try searching our database.

can paint panel scrollable ?

Thread view: 
javaSwing - 24 Feb 2005 14:22 GMT
problem is:

a JPanel is 300 width and 300 height
now i draw some graphics(not image) on this panel using
paintComponent(..) method
but the graphics get a size of 300x400.
the JPanel is set resizeable to false, so how to display the graphics
properly ?
klynn47@comcast.net - 24 Feb 2005 22:13 GMT
I would suggest creating a JScrollPane and adding the panel to it.
Whenever you draw on the panel, reset the preferred size and revalidate
it so that if you can't see all of the things you've drawn, there will
be scrollbars so that you can scroll to see everything on the panel.
javaSwing - 25 Feb 2005 10:07 GMT
thanks, i'll try it


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.