Is correct? Application (JFrame) to Applet (JApplet)

I need to convert a java application (JFrame) into an applet (JApplet), and I have seen a few "big steps":

1? make the class extends to JApplet instead of a JFrame

2? To replace the construction method by init ()

3? To comment the main method

Is correct?, because I have some doubts that later I磍l explain

Thanks

[349 byte] By [jmgmyla] at [2007-10-2 22:23:06]
# 1
Its a good start. But without knowing the exact code of your JFrame we can't say for sure.So just try it and you will find out your answer faster than waiting for someone here to give you a definitive answer.
camickra at 2007-7-14 1:40:26 > top of Java-index,Desktop,Core GUI APIs...
# 2

Thanks camickr. My original code is too long, I will try to put my errors of compilation before to put the code (because he is very long)

When I have this changes, I compile and it gives me an error (among others):

( in the init() method )

MainClassFile.java:165: call to super must be first statement in constructor

super("Title of my Application");

^

It is because in the JFrame, I have in my constructor method a call to super method.

Why this?, Can磘 I to call to super in que init method of a JApplet?

Thanks

jmgmyla at 2007-7-14 1:40:26 > top of Java-index,Desktop,Core GUI APIs...
# 3
The "init" method is not the constructor for the class so you can't use super(...);
camickra at 2007-7-14 1:40:26 > top of Java-index,Desktop,Core GUI APIs...
# 4
It would be enough with commenting it?
jmgmyla at 2007-7-14 1:40:26 > top of Java-index,Desktop,Core GUI APIs...
# 5

I have said it, because in my application I have other files where I have calls to super method like (for example):

super(MainClassFile.mainWindow, " Attention!", true);

the error it generates is:

File.java:1638: cannot resolve symbol

symbol : constructor JDialog (MainClassFile,java.lang.String,boolean)

location: class javax.swing.JDialog

super(MainClassFile.mainWindow, " Attention!", true);

^

and if I comment this line, It does not compile.:(

jmgmyla at 2007-7-14 1:40:26 > top of Java-index,Desktop,Core GUI APIs...
# 6
Read the API.Does the contructor of JApplet accept any paramenters?You can only invoke super(...) if one of the constructors accepts different parameters.
camickra at 2007-7-14 1:40:26 > top of Java-index,Desktop,Core GUI APIs...
# 7

I think in the init method (in a JApplet) I cannot call the super method. but my problem is how to change this? if in others files (in Files.java) I have calls to super metod, because thus it constructs a dialog box, asking for a file.

In file Files.java I have a class called "Abort" (extends to JDialog) in whitch:

/* class Files.java */

class Abort extends JDialog

{

boolean abort = true;

JTextArea mensage = null;

JButton acept = new JButton("Acept");

JButton cancel = new JButton("Cancel");

Abort(String nanemFile)

{

super(MainClassFile.mainWindow, " Attention!", true);

....

}

....

/* clas Files.java */

Please help

jmgmyla at 2007-7-14 1:40:26 > top of Java-index,Desktop,Core GUI APIs...