Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

swing graphics problem

Status
Not open for further replies.

rotovegasBoy

Programmer
Sep 16, 1999
88
NZ
I posted a while ago about having a problem using swing and wat components in a gui.  Several people told me that i shouldn't mix swing and awt. so i've since recoded and it works now I have a problem that i have some images drawn using the Graphics class and these are attatched to a scrollpane when the pane is scrolled down the graphics remain and go over another panel and the menubar until the edge of the window i've tried using the Graphics@d class but the same problem persists any ideas?
 
Hi,<br><br>Try using setViewportView(Component view) method of JScrollPane.<br><br>e.g.<br><br>JScrollPane scrollpane = new JScrollPane();<br>&nbsp;scrollpane.setViewportView(myBigComponentToScroll);<br>&nbsp;<br>If this does not solve your problem, let the experts have a look at your code ... try the site below for debugging...<br><br>-Amol <p> <br><a href=mailto: > </a><br><a href= site for Debugging !</a><br>Try this site for debugging...
 
Figured it out.&nbsp;&nbsp;I was overriding paint() in JPanel.&nbsp;&nbsp;This is actually and AWT function from the Component class.&nbsp;&nbsp;What I had to was override paintComponent() which was from the JComponent class.&nbsp;&nbsp;Thanx for the site though. <p>Chris Packham<br><a href=mailto:kriz@i4free.co.nz>kriz@i4free.co.nz</a><br><a href= > </a><br>No really I don't mind recruiting, just send me an email if you want a copy of my CV.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top