• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP: JApplet graphics problem

 
Jade C. Foxx
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm having a problem with my graphics not displaying properly after minimizing, maximizing, or hiding, the browser (or appletviewer) or if another browser window happens to cover the JApplet.
I am working on a photo album type JApplet. What happens to it after the browser (or appletviewer) is hidden then shown again is that the current photo (lets say element 4 in my image array) either becomes the photo before (the element 3 image) or the photo after (the element 5 image) - (depending upon whether the user last chose the "previous" or "next" button). I have used ComponentListener && System.out.println to track the value of my images upon hidden/shown and the value remains correct yet the image displayed is wrong. (In other words the value printed in the cmd window is 4 but the image shown is 3 or 5)
In the past I have viewed other JApplets that have this same problem. Is there any way to prevent the graphics from changing?
This info may help:
I am using an inner class that extends JPanel (with both foreground and background images) and also contains my paintComponent method.
As long as I don't screw around with the browser (or appletviewer) or open any other windows my JApplet works perfectly!!!???
PLEASE HELP ME
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi JavaFoxx !
Welcome to Java Ranch. We don't have many rules here, but we do have a naming policy. WHen you get a chance, please click on "My Profile" way up there and fix yer handle.
In any event, on to your problem: if you showed us the code, we could critique it. Let's see!
 
Jade C. Foxx
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about the naming policy Ernest
I have updated my profile!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic