How to compile these code by gcj?

M

Mike Mike

hi
I met some trouble!
Is there anyone can tell me how to compile these code with gcj?
Thanks

import java.applet.*;
import java.awt.*;

/**
* The HelloWorld class implements an applet that
* simply displays "Hello World!".
*/
public class HelloWorld extends Applet{
public void paint(Graphics g){
g.drawString("Hello World1",50,25);//Display "Hello World"
}
}

---------------------------------------------BY MIKE
 
M

Mike

hi
I met some trouble!
Is there anyone can tell me how to compile these code with gcj?
Thanks

import java.applet.*;
import java.awt.*;

/**
* The HelloWorld class implements an applet that
* simply displays "Hello World!".
*/
public class HelloWorld extends Applet{
public void paint(Graphics g){
g.drawString("Hello World1",50,25);//Display "Hello World"
}
}

---------------------------------------------BY MIKE

Since this code is an applet and gcj compiles to native
machine code, then using gcj for this purpose is not right.
If you want to compile a stand-alone application with gcj,
that would be fine.

public class HelloWorld {
public static void main(String args[]) {
System.out.println(args[0]);
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,130
Latest member
MitchellTe
Top