Moving Applet Problem

Moving Applet Problem

When image scroll in applet then a blinking on image is continuously working.how to remove this blinking..

import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;

public class PlaneAnimation extends Applet implements Runnable
{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    Thread t1=new Thread(this);
    int maxx=0,maxy=0;
    Image plane;
    @Override
    public void init() 
    {
        setSize(750,600);
        setBackground(Color.BLACK);
        plane=getImage(getDocumentBase(),"AnimatedAirplane.gif");
        t1.start();
    }
    @Override
    public void run() 
    {
        try
        {
            for (int i = 0; i < 800; i++)
            {
                maxx++;
                maxy++;
                Thread.sleep(20);
                repaint();
            }
        }
        catch (InterruptedException e) 
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    @Override
    public void paint(Graphics g) 
    {
        g.drawImage(plane, maxx, maxy, null);
    }
}
View Answers









Related Tutorials/Questions & Answers:
Moving Applet Problem
Moving Applet Problem  When image scroll in applet then a blinking on image is continuously working.how to remove this blinking.. import... java.awt.Image; public class PlaneAnimation extends Applet implements Runnable
Moving ball - Applet
Moving ball  import java.awt.*; import java.applet.*; import java.lang.Thread; import java.lang.*; public class Moving_ball extends Applet...) {} } } public static void main(String args[]) { Moving_ball mb=new
Advertisements
problem with applet plugin - Applet
problem with applet plugin  hello friends, iam using Eclipse IDE. i created one applet and i want to plugin that applet into webpage.. when i am...-->com.ezsoft.applets.Upload.java please friends how can i resolve that problem
applet problem - Applet
applet problem  How can I create a file in client side by a java applet . Surely it will need a signed applet .But how can a signed applet create a file in the client side
java applet problem - Applet
java applet problem  i was doing a program using java applet. I want... and to exit from the applet respectively.Now i want to display a message when...*; import java.awt.*; public class Calculator extends Applet implements
Problem in show card in applet.
Problem in show card in applet.  The following link contained the card demo with applet. http://www.roseindia.net/java/java... but Not show card in the applet, then I add a code in paintComponent method like
Problem with display of images in applets - Applet
Problem with display of images in applets  Hi all, When I run... java.applet.*; public class image extends Applet { Image img; public... in figuring out the problem....  Hi frined, import java.applet.*; import
Problem In applet Its run on browser but hang and blinking when image is draging some where.
Problem In applet Its run on browser but hang and blinking when image is draging some where.  I am Created applet in working properly on browser... draging one card, applet is refreshing and blinking continue when I am moving
Applet run with appletviewer but not in browser, any code problem.
Applet run with appletviewer but not in browser, any code problem.  Hi,My problem is when I am running my applet in appletviewer index.html, Its work... the 52 cards will be show in browser as by "appletviewer" and run as "java applet" I
problem of writing to a local file ( JApplet ) - Applet
problem of writing to a local file ( JApplet )  Dear All, I want to program a guestbook using java applets but now I have problem of writing to a file from JApplet. it is working without any problem if i run the program using
Code Problem - Applet
Moving The Images
Moving The Images  How to moving multiple images in one frame using swings
Applet
Applet  Write an applet to display a string in an applet. String should be passed as a parameter to an applet
applet
applet  What is the immediate superclass of the Applet class
Applet
Applet  how to run an applet on a web browser
applet
applet  Explain different stages in the lifecycle of an applet with figure.   Stages of Applet: Life cycle of an Applet: init(): This method is called to initialized an applet start(): This method is called after
Applet
Applet  Give the class hierarchy of an Applet class
Applet
Applet  Write a ava applet that sets blue color foreground and yellow color background at the start of an applet
Applet
Applet  Explain the start() and stop() methods of applet life cycle.   Start and Start method of Applet Life Cycle Start () method: The start method of an applet is called after the initialization method init
Applet
Applet  Write a short note on applet life cycle
Applet
Applet  I have a java applet that has a button. On clicking the button it should disappear and another applet should appear. How to write this code???? Also in login applet after successful login it should display admin applet
Applet
Applet  Draw the class hierarchy of an Applet class. Also explain how to set background and forground colors in java
applet
applet  what is applet in java   An applet is a small program that can be sent along with a Web page to a user. Java applets can perform... the following link: Applet Tutorials
Applet
Applet  Write a Java applet that drwas a line between 2 points. The co-ordinates of 2 points should be passed as parametrs from html file. The color of the line should be red
applet
applet  applet to open new tab not working.here's my code import java.applet.*; import java.awt.*; import java.net.*; import java.awt.event.*; public class NewURL extends Applet implements ActionListener{ public void init
Manhattan Moving Services
Manhattan Moving Services  **Deleted by admin *** - Shleppers Moving &
applet program code - Applet
applet program code  hello sir, i did't get the code for below problem... please help me... 1.An applet program to draw a line graph for y=2x+5.[for suitable values of x & y
moving function - Java3D
moving function  i am working on one project in java. can their is function available for speed. i want move 2d ball with appropriate speed. can i..., Plz give full details with source code where you having the problem
scrolling text in applet
scrolling text in applet  applet to display the scrolling text. The text should move from right to left. When it reaches to start of the applet border, it should stop moving and restart from the left. When the applet
applet - Applet
.  Hi Friend, Try the following code: 1)Create an applet... extends Applet{ public void paint(Graphics g){ g.drawString("Welcome in Java Applet.",40,20); } } 2) Call this applet with html code
Applet - Applet
Applet  what is the concept of applet? what is different between the applet concept and HTML? what is mean by swing?  Hi friend, Applet Applet is java program that can be embedded into HTML pages. Java applets
applet - Applet
*; import java.awt.*; public class CreateTextBox extends Applet implements.../applet/ Thanks
Applet issue
Applet issue  Hello, Can there be any problem in writing a file to the temp directory from a url using applet??? If some security problems are there please do post it for me
how to run applet - Applet
in applet program. this is executed successfully with appletviewer command >...://www.roseindia.net/java/example/java/applet/ http://www.roseindia.net/java/example/java/applet/FirstApplet.shtml Hope that it will be helpful for you.Even
Applet - Applet
Applet   Namaste, I want to create a Menu, the menu name is "Display... java.awt.event.*; public class menu2frame extends Applet implements WindowListener...------------------------"); g.drawString("Demo of Java Applet Window Event Program"); g.drawString("Java
applet servlet communication - Applet
applet servlet communication  Can anybody tell me applet - servlet... project in eclipse and writing the applet code in ajava file which is present in src... that the applet class is not found, but if I am copying t=all the classes
ModuleNotFoundError: No module named 'moving_pictures'
ModuleNotFoundError: No module named 'moving_pictures'  Hi, My... named 'moving_pictures' How to remove the ModuleNotFoundError: No module named 'moving_pictures' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'moving-chameleon'
ModuleNotFoundError: No module named 'moving-chameleon'  Hi, My... named 'moving-chameleon' How to remove the ModuleNotFoundError: No module named 'moving-chameleon' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'moving-stars'
ModuleNotFoundError: No module named 'moving-stars'  Hi, My Python... 'moving-stars' How to remove the ModuleNotFoundError: No module named 'moving-stars' error? Thanks   Hi, In your python
Applet codebase
Applet codebase  What is codebase in applet
embedding class in an applet - Applet
embedding class in an applet  I have an applet that has a set... java.awt.event.*; public class tesURL extends Applet implements ActionListener... a remote controller). I have the applet code for the remote controller
Servlet and Applet - Applet
Invoke and run an Applet from Servlet  How can i invoke and run an applet from servlet. Can anyone provide me the sample code
java - Applet
java  what is applet
animation in applet - Applet
animation in applet  Hello sir, your code is ok but what happend to this code can you modify this an tell me problem please code: import... Moveplane extends Applet { public void paint(Graphics g) { Font f=new Font("Arial
creating hyperlinks in applet - Applet
creating hyperlinks in applet  Dear sir, how can i move from one applet to another applet and how can i use previous applet input data in anotherapplet(just like session tracking) thanks
Applet JSP communication - Applet
Applet JSP communication  Hi.. I've an application where i need to get the data from the applet to JSP... How can i do this..?? can anyone explain with a sample code
applet running but no display - Applet
applet running but no display  Hai, Thanks for the post. I have... from a client, the page appears with a blank applet part (just whitescreen..., it is showing that the "Applet as1 started". Please help me to solve this issue
applet Question
applet Question  Write a java applet to display a circle in a rectangle
applet question
applet question  Write a java applet to display a rectangle inside a circle
applet question
applet question  Write a java applet to display atriangle inside a circle

Ads