import java.awt.*;
import javax.swing.*;
public class Applet14 extends JApplet
{
Thread t = new Thread();
int a;
int tot;
float piggy = 3.98f;
String cat = "TOTAL IS ";
String bubba = JOptionPane.showInputDialog("ENTER NUMBER ?");
int horse = Integer.parseInt(bubba); //Convert bubba to an int
public void paint(Graphics g)
{
Font turkey = new Font("Arial",Font.BOLD,24); //declare new font
g.setFont(turkey); //set font
g.setColor(Color.yellow); //Background
g.fillRect(1,1,500,500);
g.setColor(Color.red); //Draw textbox
g.fillRect(65,165,300,50);
g.setColor(Color.blue); //Font color
for(a=1;a<=horse;a++) //loop from 1 to the number input
{
tot = tot + a; //add up the numbers from 1 to
} //the number that was input
cat = cat + tot; //Example of concatenate
g.drawString(cat,100,200); //Draw string (String,x-pos,y-pos)
}
}