Post the relevant code in code tags and post the compiler message(s) and I'll look at it for you..
hey keang,
thanks for showing interest.
Code:
package encryptionproject;
import java.applet.Applet;
import java.awt.*;
public class EncryptionProject extends Applet
{
public EncryptionProject()
{
}
public static void main(String args[])
{
EncryptionProjectPanel encryptionprojectpanel = new EncryptionProjectPanel();
Frame frame = new Frame();
_cls1 _lcls1 = new Object() /* anonymous class not found*/
class _anm1 {}
;
frame.addWindowListener(_lcls1);
frame.add(encryptionprojectpanel);
frame.setLocation(200, 200);
frame.pack();
frame.setVisible(true);
}
public void init()
{
EncryptionProjectPanel encryptionprojectpanel = new EncryptionProjectPanel();
setBackground(Color.lightGray);
add(encryptionprojectpanel);
}
public static final Font MONOSPACE_FONT = new Font("Monospaced", 0, 12);
public static final Font MONOSPACE_LARGE_FONT = new Font("Monospaced", 0, 14);
public static final Font CODE_FONT = new Font("Monospaced", 0, 10);
}
OUTPUT:
run:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol
symbol: class _cls1
location: class encryptionproject.EncryptionProject
at encryptionproject.EncryptionProject.main(EncryptionProject.java:17)
Java Result: 1
as in _cls1 is an undefined class and when i replace it with object it say unmatched allocation.
I think you need to explain what you were trying to do when you wrote the line:
Code:
_cls1 _lcls1 = new Object() /* anonymous class not found*/
class _anm1 {}
;
This isn't legal Java - you don't declare anonymous classes like this if that's what you were trying to do. Also the compiler is saying there is no class called _cls1 on the classpath so the declaration of variable _lcls1 is not valid.
BTW You should use Java naming standards (eg Class name start with a capital letter etc) as it makes the code so much easier for other people (eg me) to read.
I think you need to explain what you were trying to do when you wrote the line:
Code:
_cls1 _lcls1 = new Object() /* anonymous class not found*/
class _anm1 {}
;
This isn't legal Java - you don't declare anonymous classes like this if that's what you were trying to do. Also the compiler is saying there is no class called _cls1 on the classpath so the declaration of variable _lcls1 is not valid.
BTW You should use Java naming standards (eg Class name start with a capital letter etc) as it makes the code so much easier for other people (eg me) to read.
actually i got this code by decompiling several class file.
i plan to extend this project so i thought of decompiling the class file and then work on it.
I tried contacting the owner..but he was out of reach..
is there a way that we can build this applet without the anonymous class..i haven't used anonymous class ever, so i am a bit confused how it helps in this code.
and its only in the UI so could we write a new UI code and make it work?
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.