hey everyone...i was compiling a project code...
but it is having a very small error..please take a look and help me...
its a sincere request...
Printable View
hey everyone...i was compiling a project code...
but it is having a very small error..please take a look and help me...
its a sincere request...
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.
OUTPUT: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);
}
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 have the same error at 3 different places in the project.
mayb if you compile the project i attached, it'll help you.
please help me..:)
I think you need to explain what you were trying to do when you wrote the line: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.Code:_cls1 _lcls1 = new Object() /* anonymous class not found*/
class _anm1 {}
;
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.
http://www.levidsmith.com/gitcommand...onProject.html
this is the applet of the original code.
the code i got is by decompling all the class files of this applet. so technically it should have no errors..!!:/
Decompilers can often struggle to successfully decompile anonymous inner classes.Quote:
the code i got is by decompling all the class files of this applet. so technically it should have no errors..!!:/
Can't you get the original source?
Do you have the legal right to decompile this code, doing this often breaches the license it is issued under.
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?
Yes, if you can work out what the anonymous class does you can rewrite it as top level class.Quote:
is there a way that we can build this applet without the anonymous class
Unfortunately, I can't help you do this unless I'm confident you aren't infringing someone's license.