ActionListener not responding (JRadioButton)

Hi all

I have a JMenuBar with a couple of JMenu's. One of them has a couple of JRadioButtons which, when clicked, do not trigger an event.

The situation ( simplified). I have 2 classes, MainClass.java and TheToolBar.java.

MainClass.java:publicclass MainClassextends JApplet{

protected TheMenuBar tmb;

.....

privatevoid jbInit()throws Exception{

tmb =new TheMenuBar(new ToolBarAction());

.......// other things that make the frame visible

}

publicclass ToolBarActionimplements ActionListener{

public ToolBarAction(){}

publicvoid actionPerformed(ActionEvent e)

{

System.out.println("action....") ;

}

}

}

TheToolBar: import........

publicclass TheMenuBarextends JMenuBar{

public TheMenuBar(ActionListener a){

JMenu jm =new JMenu();

RadioButton jmi =new JRadioButton();

jmi.setText("click me");

jmi.addActionListener(tba);

jm.add(jmi) ;

this.add(jm) ;

// and init other JMs

}

}

This is basically what happens, and the result is that I cannot select the radio button. I wonder if anyone can see what I do wrong here (I have the feeling it is something very basic)

Thnx a lot

LuCa

[2467 byte] By [LuCaa] at [2007-11-27 8:12:10]
# 1
Update: I recompiled it with a 1.4.2 compiler, instead of a 1.5.x and it all worked!!I guess I use something which is deprecated!cheersLuCa
LuCaa at 2007-7-12 19:56:30 > top of Java-index,Java Essentials,Java Programming...