We were taught about Applets these days. I was quite bored writing the codes and seeing the output on the console and dancing with joy that the code actually worked, but now began the interesting part when we started with the graphical side of java.
An applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java-compatible web browser. Applets use the AWT.
Applet provides all necessary support for applet execution, such as starting and stopping. It also provides methods that load and display images, and methods that load and play audio clips.
Example : A simple example that shows colored text using java applet and color classes.
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Color;
public class ColorHello extends Applet{
public void paint(Graphics g){
g.setColor(Color.blue);
g.drawString("Hello World...",30,180);
}
}
OUTPUT:-
An applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java-compatible web browser. Applets use the AWT.
Applet provides all necessary support for applet execution, such as starting and stopping. It also provides methods that load and display images, and methods that load and play audio clips.
Example : A simple example that shows colored text using java applet and color classes.
import java.awt.Graphics;
import java.awt.Color;
public class ColorHello extends Applet{
public void paint(Graphics g){
g.setColor(Color.blue);
g.drawString("Hello World...",30,180);
}
}
OUTPUT:-