i'm leaning about ActionListener but i can't compile my code, i don't know why :(

this is the code

package javaapplication7;

import java.applet.Applet;
import java.awt.Button;
import java.awt.Color;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

   public class Test extends Applet implements ActionListener{
   Button b1=new Button("Red");
   Button b2=new Button("Green");
   Button b3=new Button("Blue");
   Label l1=new Label("Smith");

   public void init(){

   public void actionPerformed(ActionEvent e){
     else if(e.getSource()==b2)
     else if(e.getSource()==b3)

    public static void main(String[] args) {
      // Test t;

What's the complete exact error message from the compiler?

there is no error message, when i press the compile button nothing happen at all.

this is the message "BUILD SUCCESSFUL (total time: 0 seconds)"

i can create a simple programme and compile it but in ActionListener not

Sorry to keep asking, but it's important that we get this straight. Which of the following two statements is true?
1: when i press the compile button nothing happens at all.
2. when i press the compile button I get the message "BUILD SUCCESSFUL ..."

when i press the compile button it shows "BUILD SUCCESSFUL (total time: 0 seconds)" and thats it!

i think my problem in the main class

That looks like it compiles correctly but when it executes it does nothing. Your main method has no executable statements in it, so of course it doesn't do anything. But if you are running this as an Applet then main isn't relevant.

then how to fix this error? by the way i didn't write the code, i want just to test and learn from it. i need to compile it

do you have any way to fix that?

You did compile it. Now you need to execute it. You fill find many many tutorials on the web on how to execute a Java applet.

commented: thank you :) +2

ok thanks for your help :)