Original Post
No mater what i do, i get an error, i went from 2 errors, i fixed them now i got 12 errors that i cant see how it errors, here is my code so far: here is the error log: can any one tell me exactly what is wrong, it all worked perfictly before the action listener was in it, then it went one error after another. thanks in advance - thoover
import java.applet.AudioClip;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
public class mainpage extends JApplet implements ActionListener
{
public void init()
{
bg="main.jpg";
log="login.jpg";
neu="new.jpg";
}
public void paint(Graphics artist)
{
Image photo = getImage( getCodeBase(), bg);
artist.drawImage(photo, 0, 0,this);
Image lgi = getImage( getCodeBase(), loh);
lgi.addActionListener(this);
artist.drawImage(lgi, 100,100,this);
Image nur = getImage( getCodeBase(), neu);
nur.addActionListener(this);
artist.drawImage(nur, 200,100,this);
}
public void actionPreformed(ActionEvent e)
{
if(e.getActionCommand() == lgi) new userslog();
if(e.getActionCommand() == nur) new usersneu();
}
}
class userslog extends JApplet
{
public void log(Graphics artist)
{
Image p = getImage( getCodeBase(), "main.jpg");
artist.drawImage(p, 0, 0,this);
}
}
class usersneu extends JApplet
{
public void log(Graphics artist)
{
Image p = getImage( getCodeBase(), "main.jpg");
artist.drawImage(p, 0, 0,this);
}
}
mainpage.java:7: mainpage is not abstract and does not override abstract meth
actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
public class mainpage extends JApplet implements ActionListener
^
mainpage.java:11: cannot find symbol
symbol : variable bg
location: class mainpage
bg="main.jpg";
^
mainpage.java:12: log has private access in java.awt.Component
log="login.jpg";
^
mainpage.java:12: incompatible types
found : java.lang.String
required: java.util.logging.Logger
log="login.jpg";
^
mainpage.java:13: cannot find symbol
symbol : variable neu
location: class mainpage
neu="new.jpg";
^
mainpage.java:17: cannot find symbol
symbol : variable bg
location: class mainpage
Image photo = getImage( getCodeBase(), bg);
^
mainpage.java:19: cannot find symbol
symbol : variable loh
location: class mainpage
Image lgi = getImage( getCodeBase(), loh);
^
mainpage.java:20: cannot find symbol
symbol : method addActionListener(mainpage)
location: class java.awt.Image
lgi.addActionListener(this);
^
mainpage.java:22: cannot find symbol
symbol : variable neu
location: class mainpage
Image nur = getImage( getCodeBase(), neu);
^
mainpage.java:23: cannot find symbol
symbol : method addActionListener(mainpage)
location: class java.awt.Image
nur.addActionListener(this);
^
mainpage.java:28: cannot find symbol
symbol : variable lgi
location: class mainpage
if(e.getActionCommand() == lgi) new userslog();
^
mainpage.java:29: cannot find symbol
symbol : variable nur
location: class mainpage
if(e.getActionCommand() == nur) new usersneu();
^
12 errors