Computing.Net > Forums > Programming > java parsing error!!!!!

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

java parsing error!!!!!

Reply to Message Icon

Name: sudoku
Date: July 13, 2008 at 07:34:37 Pacific
OS: winxp
CPU/Ram: 3.2ghz
Product: assmbled
Comment:

hi,i hv a problem with this java prog when i compile it says reached end of file while parsing }^. i know tht means i hv left a brace somewhere so when i check the program and pair up braces no . of errors increase can u plz help me compile it???? this is my prog-import java.awt.*;
import java.applet.*;
import java .awt.event.*;
import java.swing.*;
public class popup extends JApplet implements ActionListner
{
JLabel l1;
JPopupmenu pm;
public void poptest()
{
l1=new label("right cclick");
pm=new popupmenu();

JMenuitem mblue=new JMenuitem("BLUE");
JMenuitem mcyan=new JMenuitem("CYAN");
JMenuitem mred=new JMenuitem("RED");

pm.add(mblue);
pm.add(mcyan);
pm.add(red);

mblue.addActonListner(this);

mcyan.addActonListner(this);

mred.addActonListner(this);

add(l1);
addMouseListner(new myclass());
}

class myclass extends MouseAdapter
{
public void MouseReleased(MouseEvent e)
{
if(e.ispopupTrigger())
{
popshow(e.getcomponent(),e.getx(),e.gety());


popup pt=new popup();

pt.settitle("mimi popup");
pt.setVIsible(true);
pt.setsize(400,400);

pt.getcontentpane.add(pm);
}
}
}




Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: July 13, 2008 at 13:20:31 Pacific
Reply:

Hey, ever wonder why programmers love to indent so much? 'Cause it helps when scanning and reading the code!


java.awt.*;
import java.applet.*;
import java .awt.event.*;
import java.swing.*;
public class popup extends JApplet implements ActionListner
{
JLabel l1;
JPopupmenu pm;
public void poptest()
{
l1=new label("right cclick");
pm=new popupmenu();

JMenuitem mblue=new JMenuitem("BLUE");
JMenuitem mcyan=new JMenuitem("CYAN");
JMenuitem mred=new JMenuitem("RED");

pm.add(mblue);
pm.add(mcyan);
pm.add(red);

mblue.addActonListner(this);

mcyan.addActonListner(this);

mred.addActonListner(this);

add(l1);
addMouseListner(new myclass());
}

class myclass extends MouseAdapter
{
public void MouseReleased(MouseEvent e)
{
if(e.ispopupTrigger())
{
popshow(e.getcomponent(),e.getx(),e.gety());


popup pt=new popup();

pt.settitle("mimi popup");
pt.setVIsible(true);
pt.setsize(400,400);

pt.getcontentpane.add(pm);
}
}
}

Find it yet?


No? Then read this: You never closed this:
public class popup extends JApplet implements ActionListner


0

Response Number 2
Name: klint
Date: July 14, 2008 at 14:24:54 Pacific
Reply:

And I guess, once you've corrected that, the compiler will then complain that it can't find interface ActionListner. But at the moment it doesn't worry about the spelling until you get the punctuation right!


0

Response Number 3
Name: do1eh
Date: July 21, 2008 at 05:36:29 Pacific
Reply:

just add }


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: java parsing error!!!!!

parse error www.computing.net/answers/programming/parse-error/12417.html

parse error before `foo' www.computing.net/answers/programming/parse-error-before-foo/3511.html

Php connection parse error www.computing.net/answers/programming/php-connection-parse-error/19468.html