Screen doesn't clear between looping images

Problem with an applet. It automatically loops through images that are loaded from a separate file called Pic. The images have been drawn as graphics objects, so aren't images like gifs. But repaint doesn't clear the previous graphic object, so they load on top of each other. If I manually refresh, the previous graphic does disappear. Can anyone help?? The code is:
<pre>
import java.awt.*;
import java.awt.event.*;
import java.util.Random;
import javax.swing.*;
/* <APPLET CODE="Stage3.class" HEIGHT=300 WIDTH=300></APPLET> */
public class Stage3 extends JApplet implements ActionListener {
Pic pic1 = new Pic();
int current = 0;
Timer timer;
boolean frozen = false;
public void init() {
setBackground(Color.white);
int delay = 2000;
timer = new Timer(delay, this);
timer.setInitialDelay(0);
timer.setCoalesce(true);
pic1.rollValue(9);
//Invoked by the browser only. invokeLater not needed
//because startAnimation can be called from any thread.
public void start() {
startAnimation();
//Can be invoked from any thread.
public synchronized void startAnimation() {
if (frozen) { }
else {
//Start animating!
if (!timer.isRunning()) {
timer.start();
public void paint( Graphics g ) {
g.setColor(this.getBackground());
pic1.drawPic(g, 5, 50);
public void actionPerformed(ActionEvent e) {
pic1.rollValue(9);
repaint();
</pre>

I find calling validate(); invalidate(); works for me but I never tried it in an applet.

Similar Messages

  • Since backing up my iPad air and installing IOS 8.1.2 the screen doesn't move between landscape or portrait when I turn it. Any tips for getting it to do so?

    Since backing up my iPad air and installing IOS 8.1.2 the screen only shows the portrait view and won't change to landscape view when I turn the device. Any tips for getting back both views?

    If you see a lock icon in the upper right corner of the screen - then the screen orientation is locked.
    Try the side switch above the volume rocker first and see if that unlocks the screen. If that didn't work, swipe up from the bottom of the screen to get to the control center and the lock icon is in the row of icons at the top all the way to the right.
    If the screen is unlocked but still will not rotate, reset the iPad.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the button

  • The image came up on my screen saying that I need to connect my iPod to iTunes, but I have a passcode, so it won't allow me to. And I want to try and turn it off, but my touch screen doesn't seem to be working either. HELP!

    The image came up on my screen saying that I need to connect my iPod to iTunes, but I have a passcode, so it won't allow me to. And I want to try and turn it off, but my touch screen doesn't seem to be working either, so I can't even turn it off since you need to "slide to power off." HELP! I'm leaving on Thursday morning for six and a half weeks, and I absolutely need my iPod with me. I was just at the Apple store today for problems I was having with ANOTHER product, and I don't really want to drive all the way out to where my nearest store is (which is not very near) if I can figure this out at home. My iPod was working totally fine earlier today and last night, so I don't know what happened! Please, please, PLEASE HELP!

    Now it's allowing me to reboot (hold down power button and home button and restart), but every time it just comes up to the same thing: the connect to iTunes page. Which is not possible. And I refuse to restore my iPod. PLEASE HELP.

  • I have been opening up my photos from My Pictures folder and Elements 12 opens up but the photo doesn't appear in the image screen.  Over the weekend it was working fine.  I tried the other photo software I have and they open up in those but not the eleme

    I have been opening up my photos from My Pictures folder and Elements 12 opens up but the photo doesn't appear in the image screen.  Over the weekend it was working fine.  I tried the other photo software I have and they open up in those but not in the elements 12.

    Which operating system are you running on?
    How are you trying to open the photos?
    - from windows explorer? - double licking or right clicking and selecting Open with?
    - by loading the editor and go to File -> Open?
    Looking back at your other threads you seem to have had this problem before - what keeps changing?
    Brian

  • Color Discrepency between Develop image and Print Preview

    Is there any way to alter the color image in the Develop module so that it matches the color of the image in the print preview screen? The colors in the final printed image match those of the ones displayed in the print preview screen and are nothing like the colors I am adjusting in the Develop module. Thanks for the input.

    The web preview on windows machines should not match anything indeed. Internet explorer is not color managed at all (shame on you MS). If the web preview matches your print, but the develop screen doesn't it means that you have miscalibrated your screen. Your screen is probably very close to sRGB as many are and you could probably get away with just using sRGB as the screen profile (not recommended for real color management BTW). Anyways, we have seen gobs and gobs of windows color management issues come by here that turned out to be corrupt monitor profiles. As a test, try clearing the profile that you have selected in the monitor's properties dialog (and thereby selecting the default sRGB) and restarting LR. If you still see a difference between the different modules, the monitor profile was corrupt and you should recalibrate.

  • The left part of the screen doesn't work very well

    The left part of the screen doesn't work very well. It's hard to erase a letter, and impossible to me to insert the "P".
    Does it means that I need to replace the screen? Or there is a other solution?

    Basic troubleshooting steps clearly outlined in the User Guide are restart, reset, restore from backup, restore as new.
    If you've gone through ALL the troubleshooting steps and you're still having the problem, then you most likely have a hardware issue and will need to bring your phone to Apple for evaluation.

  • What is the best way to switch between multiple image buffers? AND How to synchronize saves?

    Hello,
    I'm trying to flip-flop between two buffers and wondering the best possible solution for this.  I'd like to acquire an image in one buffer, send that off to be processed, and then while that's being processed acquire a second image.  Right now I have a "Create IMAQ vi" in a for loop and have it creating 10 image locations.  I'm using a non-NI framegrabber (shame I know) which makes things a bit more difficult to replicate.  I have two while loops.  One while loop currently grabs images from the framegrabber and places in the 10 different locations.  The other while loop currently holds a case structure that does the processing.  I have created a local variable that holds all of the image locations and reads those to be processed.  I don't know if this is actually making things faster or if it's better to just make one image location.
    I have two images attached.  One image is the Grab While loop.  Since I have an array of locations, I have to use a for loop and index each one out to my display. I then have a shift register to carry the image location info over to the next iteration of the while loop.
    The second attachment is the bulk of the main while loop.  It shows what happens to the image while it's being fully processed in the left case structure.  I know it does not look like much but one of the cases (which is called by Boolean Image FFT) is a subVI that does most of the processing.  I believe that is what really slows it down because of how that program is written. 
    The right case structure shows my saving mechanism.  I have two file paths. One to save the image and the other to save the processed image.  I have a sequence to make sure they save at the same time once it gets to that point. 
    The problem though is the following:
    In the grabwhileloop.png, you can see that I have a timing to see how fast the images are being acquired.  This value is approximately 60 fps (which is the rate of the Basler camera).  There is a similar set up in the main loop case structure. This processes very slowly and is approximately 1.04 fps.  Which would mean that the image I turn into an array in the left case structure in the main while loop image is more than likely different than the image I'm trying to save off in the right case structure since the grab is occurring at the same time.  I'd like to have the processed image to save alongside the image I am processing.
    Sorry for the big bulk of text.  This code has come a long way as it is.  If you have any suggestions on making it faster or more efficient please feel free to chime in.
    Thanks,
    Rob
    Attachments:
    GrabWhileLoop.png ‏34 KB
    MainWhileLoop.png ‏68 KB

    Thanks for the comment.  I have looked into the producer/consumer architecture, but to be honest, I'm not quite sure how everything will work while doing that. I have seen the example codes, and I have thought about implementing (or at least attempting to) but I'm still unconvinced that it will run that much more efficiently.  There is other setup outside of the images that had to be done outside of either while loop. Also, I don't know where I would put both loops.
    Last time, I attempted to put the grab while loop inside of the state machine.  Things got chopped because it took so long to go through the main while loop's "acquisition" state (which is really the processing state).  I needed both to simultaneously run.  The grab reset every time it went to the "grab" state which is not what I wanted.  The only way I can thing to have combatted this was to combine the grab and acquisition in the same state.  If that were to happen, I'd take out the for loop and grab one image at a time.  However, that would still probably make things even slower than they already are.
    In terms of the doing something before an image is assigned in for loop, I don't need that pixel sum value to refresh too quickly.  As it is already, the main while loop is slow enough as it is, so I am more afraid that everything will run too slowly the more I do.  I know where the bottleneck is in my code, but I can't really see a way to "even out the flow".  Even if I moved to the other architecture, I feel it'd take the same amount of time that it does already.
    From my debugging, the Image local variable in the main while loop seems to refresh as quickly as the grab while loop spits it out.  Granted once the main while loop finally completes, main images have gone by.  This is what has to be though because it just take up so much processing power to run through the main while loop state.
    As a side note, does labview have an issue with acquiring images in real-time that you have heard of?  I ask because when I run the code, there is a solid white line that I'm supposed to see in my display.  Every time things either time out or something, the line moves which is not supposed to happen.  The line also moves every time I place my mouse cursor in the display or if I spin the mouse wheel to scroll.  If I don't do either of those things, it'll eventually move on its own.

  • I dropped my iphone and the screen has blue lines on it. Siri still works but the screen doesn't but the screen isn't cracked or shattered. What should I do?

    I dropped my iphone and the screen has blue lines on it. Siri still works but the screen doesn't but the screen isn't cracked or shattered. What should I do?

    Bring your phone and $199 to the Apple store for an out of warranty exchange of your phone.  You clearly broke it when you dropped it.

  • Payment Run - Clearing between Customer and Vendor and Partner Bank Account

    Is there a way to have the bank details for the payment to be pulled from the vendor master if an outgoing payment is created or from the customer master if an incoming payment is created? Our requirement is to consider both vendor and customer items during payment processing.  In doing so, if the net of the clearing between the customer and vendor account results in an incoming payment, we want to use the bank details specified from the customer and if the net results in an outgoing payment, we want the bank details on the vendor master to be used.
    As such we tick the box on Vendor master to clear with customer and tick the box on Customer master to clear with Vendor.  We have defined 2 payment methods and entered both payment methods on both the customer and Vendor.  We have also entered the different bank accounts on the payment transactions tab of the vendor and customer masters. 
    It seems regardless of resulting payment method chosen, the bank details are getting pulled from the vendor master.

    Hi,
    It is possible without any doing any kind of config or master data changes
    While doing F-53, after entering all the required data in open item selection screen, after getting vendor open line items, go to menu item edit->select more.
    There enter account type as D and company code (customer account no's comp code) and click on process open items
    So you can choose the line items from the other company code's customer also.
    Thanks,
    Srinu

  • How do I reduce the space between the images in the fotopage?

    Hi
    I have made a Photopage - and some of the Photos are croped and when I add them to the page there is a loot of space between the one above and underneath
    look at this screen shot
    http://skitch.com/baiaz/n8un4/iweb
    or go to my photopage:
    http://web.me.com/baiaz/Adino/Galleri/Sider/UKE1.html
    Then you will see what I mean.
    Is there a way to make them more even???? So the gap is not that big when I crop the photos?

    The photogrid is square. Your pictures are rectangle. That's difficult to fit.
    To change the settings of the photogrid, click on an image.
    You can change the number of columns, the spacing between the images, the numbers of lines for the caption and the number of pictures on a page.
    It's all there.

  • TS3274 dropped ipad now screen doesn't display

    My daughter dropped her ipad and now the screen doesn't display anything.  We can see some light changes but nothing else.  It appears that the screen can still be touched to use apps because we are able to play music.  Any suggestions on what we should do?

    Not sure if you've fixed this, but it really works.  After reading similar advice, I banged it on the corner of my couch and the display totally came back clear as day.  Could not read it before.

  • Screen refresh problem where data is entered and the screen doesn't refresh

    Many people in the company are experiencing the odd screen refresh problem where data is entered and the screen doesn't refresh to show the updated result in corresponding cell formulas.
    Microsoft have issued a hotfix to fix the issue for Excel 2003 as shown. Microsoft released a hotfix for this problem (<a href="advisory?ID=978908">KB978908</a>). Display memory tends to pick up data from hidden sheets and pastes it
    into the active screen. No impact on the file. This occurs when protecting and unprotecting worksheets in VBA. I also suspect that enabling and disabling screen refresh contributes to this problem. In any case there is a fix, albeit with the following disclaimer:
    As of yet I have not been able to find a fix for this for office 2010 and 2013, Any suggestions would be great.

    Hi,
    Based on your description, Excel does not show the text strings when you typing. It may be caused by the cell format, if we set the cell format as ";;;" in custom format, it will not display the text that you typed. 
    And the issue may be caused by the third-party input method, there are some compatibility issue between them.
    If the issue still exits, please try the following methods
    Verify/install the latest updates
    Repair your Office program
    Regards,
    George Zhao
    TechNet Community Support

  • Logon screen doesn't allow to navigate b/w fields.

    Hi,
    I have deployed successfully forms on web using Forms6.0 and
    OAS4.0.7 with 8i as the back-end.
    I have a strange problem with the Logon Screen. When I request
    for the URL it loads the applet and displays the forms Logon
    screen, here, I can't navigate between user, password and connect
    fields using tab.
    Also, the logon screen doesn't centre when request for the
    first time .. coz it depends upon resolution. Is there anyway to
    set autom resizing parameter? which resize the applet depending
    upon the resolution of the client system.
    If anybody has figured out how to make this navigation please let
    me know.
    Thanks,
    Raj
    null

    Hi,
    Try install patch3 for Developer6.
    Ruy Chicaco.
    Raj (guest) wrote:
    : Hi,
    : I have deployed successfully forms on web using Forms6.0 and
    : OAS4.0.7 with 8i as the back-end.
    : I have a strange problem with the Logon Screen. When I
    request
    : for the URL it loads the applet and displays the forms Logon
    : screen, here, I can't navigate between user, password and
    connect
    : fields using tab.
    : Also, the logon screen doesn't centre when request for the
    : first time .. coz it depends upon resolution. Is there anyway
    to
    : set autom resizing parameter? which resize the applet depending
    : upon the resolution of the client system.
    : If anybody has figured out how to make this navigation please
    let
    : me know.
    : Thanks,
    : Raj
    null

  • TS3274 If I touch camera icon, the screen turns black instead of capturing image. Let me know how to troubleshoot.

    If I touch camera icon, the screen turns black instead of capturing image. Let me know how to troubleshoot?

    Try closing the Camera app:
    1. Double-click the Home button to reveal the Task Bar
    2. Hold down the Camera app for a second or two until you see the minus sign
    3. Tap the minus sign to close app
    4. Tap area above Task Bar to return to Home screen
    If the above doesn't solve the problem, do a reset:
    Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider

  • Fastest way you switch between multiple images (CS3) ?

    I'm originally a Fireworks user (from 2001) and am starting to learn Photoshop as it is in my CS3 set and it's superiority in image editing.
    BUT, I was suprised/shocked/P.O.-ed to notice Photoshop doesn't have tabs to easily switch between images like Fireworks has had for the last 7 years.
    (Yes, I realize CS4 has that option now, but I'm not willing to dole out another $600 bucks for another upgrade )
    Anyway, enough ********.
    My question is:
    "Can you tell me how you switch between multiple images opened in Photoshop CS3?"
    I'm assuming there must be a keyboard shortcut I can't find, or something besides having to shrink down the images and routing through them . . .
    Thank you for your time and help,
    Brad

    Hi again My,
    Thanks for the reply on my other post as well.
    Ctrl+Tab
    Got it. Thank you.
    Quick and easy enough. I'm happy :-)
    Brad

Maybe you are looking for