PDA

View Full Version : Converting an Application to an Applet (Java) and adding fonts, images


XxSweetAngelz
12-04-2003, 06:58 AM
Java Application to Applet on ArithmeticTest
Hello,

I would like to know how I can convert an application to an applet.

Here's the code:

//listing 3.1
class ArithmeticTest
{
public static void main (String args[]) {
short x = 6;
int y = 4;
float a = 12.5f;
float b = 7f;

System.out.println("x is " + x + ", y is " + y);
System.out.println("x + y = " + (x + y));
System.out.println("x - y = " + (x - y));
System.out.println("x / y = " + (x / y));
System.out.println("x % y = " + (x % y));

System.out.println("a is " + a + ", b is " + b);
System.out.println("a / b = " + (a / b));

try{ System.in.read();}
catch (java.io.IOException ioe){}

}
}


This is a console application that I can run into MS-DOS to see if this works. I would like to know how I can covert this to make this a java applet.

I also would like to know how to add images, or fonts together with this applet that I'm trying to do.

Email me if you can. My email is XxSweetAngelz@aol.com

Thanks,
Eleanor

adios
12-04-2003, 07:11 AM
App or applet - this ain't no Java board. :(

Try here (http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forum&f=23). Good luck.