Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting An Application to An Applet (Java) and Adding Fonts and Images to Applet

 
Eleanor Nario
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Converting an Application to an Applet (Java) and adding fonts, images
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic