Java program to display numbers from 1 to 10 on Applet
By: Paawan Chaudhary
This is a Java program to display numbers from 1 to 10 on Applet such that each number will be displayed after delay of 100ms.
import java.applet.*;
import java.awt.*;
/*
<applet code="Numbers.class" width=300 height=300>
</applet>
*/
public class Numbers extends Applet
{
public void paint(Graphics g)
{
try
{
for(int i = 1; i <= 10; i ++)
{
g.drawString(String.valueOf(i), 100, 100 + (i * 15));
Thread.sleep(100);
}
}
catch(InterruptedException e)
{
System.out.println(e);
}
}
}
Archived Comments
1. write a prog to configre a number in html file fetch the configured
number in java prog and
View Tutorial By: sachin at 2017-04-08 18:49:10
2. Can you please give the driver class for this code.
View Tutorial By: ani at 2012-09-20 17:23:13
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Program using concept of byte long short and int in java
Update contents of a file within a jar file
Tomcat and httpd configured in port 8080 and 80
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program in Java
Calculate gross salary in Java
Calculate average sale of the week in Java
Vector in Java - Sample Program
MultiLevel Inheritance sample in Java