Write an applet to display scrolling image in an applet window using thread.

Write an applet to display scrolling image in an applet window using thread.

Write an applet to display scrolling image in an applet window using thread.

View Answers

April 4, 2013 at 1:37 AM

import java.awt.*;
import java.applet.*;
import java.awt.event.*;
/*<applet code=imgscrl height=300 width=300></applet>*/
public class imgscrl extends Applet implements Runnable 
{
    Thread t1=new Thread(this);
    Image img;
    int maxx=20,maxy=20;
    public void init() 
    {   
    img=getImage(getDocumentBase(),"Cover.jpg");
    t1.start();
    }
    public void run()
    {
        try
        {
        for(;;)
            {
        maxx+=20;
        if(maxx==1000)
            maxx=20;
        Thread.sleep(500);
        repaint();
        }
        }
        catch(Exception e)
        {
        }
        }
    public void paint(Graphics g)
    {
    g.drawImage(img,maxx,maxy,this);
    }
}









Related Tutorials/Questions & Answers:
Write an applet to display scrolling image in an applet window using thread.
Write an applet to display scrolling image in an applet window using thread.  Write an applet to display scrolling image in an applet window using thread
By using Applet display a circle in a rectangle
By using Applet display a circle in a rectangle  Write a java applet to display a circle in a rectangle
Advertisements
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
java applet prog
java applet prog  applet to display scrolling text from right to left in an applet window using thread. text should be accepted by html parameter
Display image in the applet
Display image in the applet   ... illustrates you to display image in an applet which has been done in this example... and it's properties have been used to display the image in an applet. In this program only
Write an Applet which display current date and time on the web page??
Write an Applet which display current date and time on the web page??  Write an Applet which display current date and time on the web page??  Here is an applet code that display date and time. import java.applet.
Write an Applet which display current date and time on the web page??
Write an Applet which display current date and time on the web page??  Write an Applet which display current date and time on the web page?  Here is an applet code that display date and time. import java.applet.
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
Applet  Write an applet to display a string in an applet. String should be passed as a parameter to an applet
applet is running but no display
applet is running but no display  applet is running but no display.. its showing white screen with applet started
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
Problem with display of images in applets - Applet
, this); } } --------------------------------------- Display image in Java Applet... this program, the appletviewer window is showing no output (i.e. no image). I'm... java.applet.*; public class image extends Applet { Image img; public
Java Image Browsing Applet
Java Image Browsing Applet  Hi. I want to create an applet which is embedded in html page which display image by browsing the files in the computers hard disk... Please help me out
Applet
Applet  Write a ava applet that sets blue color foreground and yellow color background at the start of an applet
Applet
Applet  Write a short note on applet life cycle
Crop Image Code in Applet
Crop Image Code in Applet  Sir, Can somebody please provide me with code to crop and save an image in applet
Crop Image Code in Applet
Crop Image Code in Applet  Sir, Can somebody please provide me with code to crop and save an image in applet
applet
applet  What is the immediate superclass of the Applet class
Applet
Applet  Give the class hierarchy of an 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  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 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
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  applet to open new tab not working.here's my code import...*; public class NewURL extends Applet implements ActionListener{ public void init... to open page in same window } catch (MalformedURLException e
Applet
Applet  Draw the class hierarchy of an Applet class. Also explain how to set background and forground colors in java
Write a Java applet to draw cylinder and pentagon shapes.
Write a Java applet to draw cylinder and pentagon shapes.  Write a Java applet to draw cylinder and pentagon shapes
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
What is Applet in Java with Example?
Example Display image in the applet Play sound in applet Applet Security... application using the Swing components. This makes applet just like desktop... To Applet Opening a URL from an Applet Opening new browser window from
How to save image on the server by applet
How to save image on the server by applet  HI, in my project I am using applet and creating a chart by jcchart. Now when the chart has ploated... as a gif image on the server directory. Can any Body help me how can I do it Thanks
How to save image on the server by applet
How to save image on the server by applet  HI, in my project I am using applet and creating a chart by jcchart. Now when the chart has ploated... as a gif image on the server directory. Can any Body help me how can I do it Thanks
Human face using applet programming - Applet
Human face using applet programming  import java.applet.*; import java.awt.*; public class Chatterjee extends Applet { public void init...........How do I proceed using ActionListener..........pls explain....  
How to write a simple java applet
How to write a simple java applet   Hi, how can i write a simple java applet, displaying text in specific colors and font style. For example... ShowsTextExample extends Applet{ public void paint(Graphics g){ g.setColor
Human face using applet programming - Applet
Human face using applet programming  import java.awt.*; import java.applet.*; public class HumanFace extends Applet{ private int mouseX, mouseY... would like to know abut this error and its solution.I am using jdk1.3 I would
Applet Write Files Example
Applet Write Files Example       In this section, you will learn how to write to a file from an applet. This is very simple but the security manager don't provide
Java Thread In Applet
Java Thread Applet is a java class that runs inside the internet browser. It is used to make the gui application, network application in java Thread is used in applet to make the multithread application Example of Java Thread
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   Namaste, I want to create a Menu, the menu name is "Display". Under Display Menu in two Item is "Shortycut Key" and "Version". when i click...------------------------"); g.drawString("Demo of Java Applet Window Event Program"); g.drawString("Java
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
applet   how to draw textboxes using applets  Hi Friend...*; import java.awt.*; public class CreateTextBox extends Applet implements.../applet/ Thanks
applet question
applet question  sir please tell me that how can i call an event on clicking on applet window without using any component
Applet
to an applet can be retrieved using getParameter() function. E.g. code:ADS... the parameter value to test the value passed from html page. Applet will display... it will display the value passed as parameter. In our case applet should display
image scrolling
image scrolling  A brief description of scrolling image
scrolling image
scrolling image  How create a scrolling image in java
The Java Applet Viewer
tags. The difference in using the applet viewer and the web browser to run... i.e. it doesn't display HTML code. So we should test our program in applet.... It displays each applet referenced by the documents in its own window. The syntax
Java Applet
Java Applet   How to add Image in Java Applet? what is getDocumentBase
Write an applet program for displaying 3 different sentences with 3 different colors
Write an applet program for displaying 3 different sentences with 3 different colors  Write an applet program for displaying 3 different sentences with 3 different colors
Write an applet program to transfer the content of the text field into the component on clicking a button
Write an applet program to transfer the content of the text field into the component on clicking a button  Write an applet program to transfer the content of the text field into the component on clicking a button

Ads