Problem clearing applet's screen for different images

I have an applet that displays several jpg-images.
Images are photos of different sizes that are portrait
and landscape.
Problem is that the rest of a portrait image remains at
the screen when a landscape image is dispayed and
in the same way the rest of a landscape image remains
at the screen when a portrait image is displayed.
I thought update and repaint methods should do the
work but something is wrong.
Code that should do it is:
private void runWork() {
   curFrame = 0;
   try {
        while(noStopRequested) {
     waitWhilePaused();
     curFrame = (curFrame + 1) % image.length;
     repaint();
     Thread.sleep(5000);
   } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
public void paint(Graphics g) {
    update(g);
public void update(Graphics g) {
   g.drawImage(image[curFrame], 0, 0, this);
}What am I doing wrong?
Thanks in advance

Yeah, I knew flickering would probably happen. I've never done double-buffering exactly in an applet, but I can give you an idea how it's done.private void runWork() {
   Image offScreen = createImage(appletWidth, appletHeight);
   Graphics offGraphics = offScreen.getGraphics();
   try {
      while (noStopRequested) {
         waitWhilePaused();
         curFrame = (curFrame + 1) % image.length;
         offScreen.clearRect(0, 0, appletWidth, appletHeight);
         offScreen.drawImage(image[curFrame], 0, 0, this);
         repaint();
   catch (...) {}Then in paint():public void paint(Graphics g) {
   g.drawImage(offScreen, 0, 0, this);
public void update(Graphics g) {
   paint(g);
}Might not be perfect, but it should give you an idea. Basically you want to draw the screen OFF the screen before drawing it to the screen. That way you don't clear the screen and draw the image. You do it all in one paint().
Michael Bishop

Similar Messages

  • Different AP/AR Invoice Screen for Different Product

    We have requirement that we want to capture
    1. Different colums settings for different product.
    2. Different UDF's for different product
    We are not able to come up with common screen for AP/AR invoice for those product as it makes screen very complicated with many unnessary column for 1 product.
    is it possible to have different screens for different products?

    Hi Avinash,
    You have go through the form settings for Raw level settings and UDF manage through create different category as per your product specification.
    But As per SAP Standard not possible different form settings for different products in A/P and A/R forms.
    for your requirement possible through SDK but thats not right way.
    Thanks,
    Srujal Patel

  • Has anyone had a problem installing the AdobePatchInstaller.exe for Raw images?

    Has anyone had a problem installing the AdobePatchInstaller.exe for Raw images?

    ssprengel;
    The message displayed when attempting to install is "Adobe Application Manager may be damaged. Download and install a new copy of Adobe Application Manager.".
    Which is not the case.

  • Need Different Selection screen for different Queries in a Workbook

    Hi,
    I have created a workbook with Multiple tabs in BI 7.0.  Each Tab has different Queries and each query has different Selection screens (Variable Selections).
    When i open the workbook and refresh it, the selection screen is appearing only for one query.  All the queries are refreshed by this single selection screen, though each query has different Variable selections.  What i need is a seperate selection screen i.e seperate Variable selection appearing for each queries, when i refresh each one of them.
    Is it possible to do this?  If anybody has tried this, help me in solving this issue.  Thanks for ur time.
    Regards,
    Murali

    Murali,
    If you un-check the 'Display Duplicate Variables Only Once' this WILL solve your problem.
    When you Refresh, you should be presented with a single variable selection dialog box, but it should contain an area for each Query (DataProvider) that is embedded in the Workbook.
    This is the case if the queries are all on the same tab, or on different tabs.
    However, if you have multiple tabs each with a query on it, each query must have it's own DataProvider. If all queries are based on the same DataProvider, it will not work as the Workbook only 'sees' one Query for which it needs variable input.
    If you REALLY want multiple variable selection dialog boxes, then maybe the best way to do this is to have the queries in separate Workbooks.
    If you don't want the User to have to open 5 queries manually, you could use a Macro in each Workbook that runs on opening, to open the next Workbook in the sequence.
    I hope this makes sense!
    Regards
    Steve

  • Customize Windows 8 start screen for sysprepped image deployment.

    I am attempting to customize the start screen of a windows 8 Pro image for deployment. I have been searching and reading different threads well as technet articles but I have not found anything that works or is not completely documented.
    I have tried the three methods outlined in the technet about customizing the start screen with no luck. http://technet.microsoft.com/en-us/library/jj134269.aspx
    The CopyProfile option does not work. Even after enabling the administrator account in audit mode the start screen tiles are not saved after sysprepping.
    Copying the AppFolderLayout.bin file or appsFolder.itemdata-ms to the default user profile does not work. The file is overwritten during the oobe process. I have added these files after sysprepping the image. They are overwritten in the default user
    profile during oobe before the new user is created.
    Using the StartTiles section of unattend would be the best option that will require fewer manual steps but only seems to be able to add new tiles. I cannot remove tiles or change order with StartTiles.
    My unattend.xml file is here: https://dl.dropboxusercontent.com/u/10327232/unattend.xml
    If anyone has a method that works for them please let me know. Especially if this can be automated using unattend.xml

    Copying the AppFolderLayout.bin file or appsFolder.itemdata-ms to the default user profile does not work.
    I think Niall's procedure sounds a bit more complicated than that.   ; )
    http://www.windows-noob.com/forums/index.php?/topic/8101-using-system-center-2012-configuration-manager-part-13-deploying-windows-8-x64-with-custom-start-screen/
    Also, regarding removal specifically, did you see Antony Mann's reference to the PowerShell DISM module?
    http://social.technet.microsoft.com/Forums/en-US/w8itproinstall/thread/cbe566f9-fe40-4344-9e7d-1dbf72178429#a59888a6-5196-47b9-91c0-9ddba6a26384
    Other good references available then via
    (Bing search for
        RemoveAppxProvisionedPackage
    HTH
    Robert Aldwinckle

  • Custom Infotype : Calling different screens for different subtypes

    Hi ,
    My custom infotype has 2 different subtypes. I want to assign these 2 subtypes with 2 different screens so that whenever a particular subtypes in used in PA20/PA30, the user gets the screen relevant to that subtype.
    I know some configuration is there but can't recall exactly what needs to be done.
    Any hints are greatly appreciated.
    Thanks a lot,
    Sandip.

    Hi Suresh, 
    thanks for the information. i tried doing that. i could hide the fields. but the problem is for both the subtypes the screen number(which i have to enter while using v_t588m) is the same. the field which i hide for subtype 1 should be available for subtype 2.
    for example consider fields a,b,c,d,e and f.
    For subtype 1 i should display a, b,c,d,f
    for subtype 2 i should display a,b,c,e.
    in the custom infotype i created i have all the fields  a,b,c,d,e and f.(currently all these fields appear for both the subtypes)
    in v_t588m i could hide the fields generally but could not do it separately for the subtypes.  hope you understood. thanks a lot Suresh.

  • Searching for multiple images across different volumes?

    Hi, is there a way or an app that can search for different images across various volumes? I need to locate 200 images for an InDesign file across 3 server volumes.
    Thanks,
    Bill

    In the Finder, press command-F to open a search window, or select
              File ▹ Find
    from the menu bar. In the search window, select
              Search: This Mac
    from the row of tokens below the toolbar.

  • Resizable page for different screen sizes but with static image content. Shall I use media query?

    I’m making a page that has of mostly image content. It’s a large circle in the middle so I want it to be centered vertically and horizontally. I also want it to stay centered and resized proportionally for different screen sizes. I’ve read about media query but it seems to me that the elements just become fluid. Can I make the elements stay in place using the media query?
    I’m working in Dreamweaver CS5.5

    Here's the code I'm working with now, I've taken away the things that I don't really understand.
    It's working but I guess it won't hold when I start with the media queries.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head><style type="text/css">
    body {}
    div {
       font: 12px Arial;
    span.bold { font-weight: bold; }
    #the-circle {
      height: 960px;
    width:960px;
    margin-left:650px;
    margin: 0px 10px 0px 10px;
    margin-left:650px;
    .link-row {
    position:absolute;
    width: 960px;
    height: 74px;
    top: 130px;
    left:660px;
    .link-row-2 {
       position: absolute;
       width: 960px;
       height: 74px;
       top: 300px;
       left:660px;
    .link-row-left {
    float: left;
    .link-row-right {
    float: right;
    .link-row-right {
    float: right;
    .link-row-right {
    float: right;
    </style></head>
    <body>
    <br /><br />
    <div id="the-circle">
    <img src="ACE Test/Logo-DW.png" width="960" height="960" />
    </div>
    <div class="link-row">
    <div class="link-row-left"><img src="ACE Fotografier EP och Video/Logo/Wix ACE Logo.png" width="111" height="74" /></div>
    </div>
    <div class="link-row-2">
    <div class="link-row-right"><img src="ACE Fotografier EP och Video/Logo/Wix ACE Logo.png" width="111" height="74" /></div>
    </div>
    </body></html>

  • Creating an app for different screen resolutions/sizes

    Hi
    I'm currently in the process of learning application development for the iPhone and could do with some help on how to cater for retina and non-retina screens. I want to create image assets for each screen type.
    What the best way to go about detecting if the user has an iPhone 4 for example and selecting the appropriate images for that resolution? I understand that you attach '2x' to file names when coding natively but for a pure Actionscript project where the assets might be contained in a swc file what would be best to do?
    Thanks

    Hi Vic,
    The biggest advantage of building apps in Flash CS5.5 or Flex is the ability to target multiple devices and the 2 major platforms, iOS and Android oh and also Blackberry (anyone?).
    Best way to approach a build is to assume you do not know the screen size your app will be used on, since Android is so all over the place.
    I have been using stage.stageHeight and stage.stageWidth religiously for all my scaling although I have heard that method has its problems, it has worked well for me, I have put out 2 apps personally and 3-4 for work using this method both in Landscape and Portrait orientations and this method has worked well.
    The easiest way to build a multi screen app is to design it for an average ratio, 3:4 being the lowest = iPad so lets say you pick some decent size that wont be too big for smaller screens like the iPhone 3gs 480x320 and wont be too low for high res screens like the new Google Nexus or the Motorola Xoom 1280x800. I usually target the iPhone 4 screen 960x640 right now it seems to fall in the middle between older phones and tablets.
    The real quick and dirty way of doing it is to build all your assets inside a movie clip and then scale that movie clip proportionally to the stage, first checking to make sure none of it would be cut off due to different screen ratios, this is not the best way of doing it but it works well and its the easiest method.
    A better way is to scale and place your content in relation to the stage, again the stage.stageWidth and Height properties are your friends so if you have an element that always goes in the middle you would place it my_mc.x = stage.stageHeight / 2 and same with the y, you can also scale it to the stage my_mc.width = stage.stageWidth/4 this way the movie clip is always 1/4th of the stage width regardless of the screen, its a lot planning up front but this method allows you to cover the entire screen instead of just cramming your movie clip in there however it fits.
    Let me know if any of that helped I can go into further detail but I feel like I am rambling on.

  • Site Formatting for different screen sizes

    Hi there,
    I am designing a website for a customer and having some problems with the site fitting on different screens.  I set it to what I was led to believe is the universal resolution/screen size, and it looks great on large, wide-screen computers, but doesn't fit right and requires lots of scrolling on smaller screens.  I also have a pop-out light box feature when visitors click TEAM and it doesn't fit on smaller screesn either.  How can I make the site auto adjust to different screens?  This is a big must for the customer and I'm still pretty new to MUSE so i don't entirely know what I'm doing.  Any help would be greatly appreciated. 
    The site is: http://apopecary01.businesscatalyst.com
    Thanks!
    Nick

    Truly variable width "liquid" layouts are not supported. However, visual designs that fill the full browser width are possible using browser fill image tiling and 100% width page items. Also page item pinning and browser fill scrolling can be leveraged to create designs where content moves relative to each other when the browser window height or width changes.
    We may be exploring responsive layout options for Muse in the future, but right now it is fixed width only.
    - Abhishek Maurya

  • I'm having a problem where Firefox keeps asking for my Amazon password, even though I tell Firefox NOT to remember this password. In Firefox options, Amazon is clearly listed as a site for which not to save passwords.

    I'm having a problem where Firefox keeps asking for my Amazon password, even though I tell Firefox NOT to remember this password. In Firefox options, Amazon is clearly listed as a site for which not to save passwords.

    Do not use [[Clear Recent History]] to clear the "Site Preferences"
    Clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.

  • Camera problem app, its giving me this purple images then the app freezes i press home button its goes fine back home screen it just the CAMERA APP ITSELF. i did RESTORE

    camera problem app, its giving me this purple images then the app freezes i press home button its goes fine back home screen it just the CAMERA APP ITSELF. i did RESTORE

    I've found a new way .. I restart the phone manually. And it works. But sometimes , the Problem reappears and sometimes it doesn't . But when it does , its just too annoying. Therefore, restarting the phone manually is a temporary solution. But what's the permanent solution for it? Let's wait and hope that someone comes up with one.
    And I hope this restarting hint solves your problem too.
    P.S- instagram or any other app won't make a difference. That's what i think .. Cz I don't have that app on my iPhone.

  • Can we have two different logon screen for the Portal

    Can we have two different logon screens for the Portal?
    We should split the Logon application in two different applications:
    Login # 1
    should be read a DataSource.XML reading the Active Directory (Microsoft), to read-only the profiles from the AD, and block some IP address range.
    Login # 2
    should be read a DataSource.XML reading the Portal user only
    Is this possible?

    Hello Developer,
    Did you find an answer to this problem. I also have a similar issue at hand and am wondering if anybody has a solution for this.
    Thanks, Akhilesh

  • I just downloaded the new Firefox 4, rebooted, and viewed you videos re the new look and new features. Problem is, my toolbars look no different than before. The new icons you talk about do not appear on my screen. Please advise. Thank you.

    I just downloaded the new Firefox 4, rebooted, and viewed your videos re the new look and new features. Problem is, my toolbars look no different than before. The new icons you talk about do not appear on my screen. Please advise. Thank you.

    The Firefox icon is the default feature for Windows Vista and 7 only, it does not apply to Windows XP users.
    To have the Firefox icon instead of the Menu Bar:
    View > Toolbars and UNCHECK the Menu Bar.
    After that, click on the Firefox icon and you'll have the Menu Bar appear again.
    http://support.mozilla.com/en-US/kb/Menu%20bar%20is%20missing

  • Scaling front panel objects for different screen sizes

    Hi,
    Can anybody help me of designing Vi for different screen sizes. I have designed a VI for a monitor of small size and lower resolution but when I open the same Vi on a different monitor,objects are not aligned properly. The properties which I have changed are
    Window appearence->Default
    Window Size -> Panel size 0,0   & Tick marked options of Maintain propotions for different monitors and scale all objects 
    Window Run Time position-> Maximum
    Regards
    Imran
    Solved!
    Go to Solution.

    Imran,
    I can't solve your problem entirely.  However when I have to write a program that will be deployed on a variety of monitor sizes, I tend to set the size of the Front Panel to suit the smallest monitor, and then remove the ability of the user to resize it.
    Also, set it to run in the centred position.
    See attachments.
    Many Thanks,
    Dan
    Dan
    CLD
    Attachments:
    Customize Window Appearance.JPG ‏44 KB
    VI Properties.JPG ‏29 KB

Maybe you are looking for

  • When your hard drive is full

    My 1tb hard drive on my 27" imac is almost full. I'm not interested in the tedious prosess of going through folders and deleting applications and files I don't use anymore. I want to keep everything. I would like to just copy the whole 1tb storage  o

  • Error in execution

    I have set the path for java correctly and checked by typing javac and java and it works I have compiled the program but it will not run However if I copy the program into bin folder it runs Can you explain why? Thks

  • [SOLVED] EeePC 1001PXD, ALSA - no sound after installation

    After Installation I Installed first Pulseaudio, then ALSA, but still I have no sound. Arch is up to date. I checked sound in Mint, so it isn't hardware problem. Drivers seem to be ok, I also unmuted all channels in alsamixer. speaker-test doesn't pr

  • Can I turn off Robo9 Meta Tags that are being inserted?

    We are having problems with the Robo9 meta tags and scripts that are being inserted in every file.  The problem is especially painful when converting older projects and then attemtping builds that fail because of the new tags and scripts.  Is there a

  • Automatic Email When Scheduled Report Fails?

    Is there a way to configure XI to automatically send an email if a scheduled report fails to run successfully?