views:

266

answers:

1

I'm having a JPanel bean which inside has two JToggle buttons.I compile and add this bean to the netbeans palette and then i add it to a frame.Then i right click the bean and from events i choose a mouse event let's say 'release'.This event corresponds to the JPanel and NOT in the two buttons inside.Thus i cannot catch mouse events coming from the JToggle buttons.How can i catch these events? I hope it's a clear question Thank you

+1  A: 

The reason that you are getting events for the JPanel is that it is the control that has currently the focus. It may be difficult or impossible to move the focus to the JToggle buttons inside the panel by clicking in the form. It is better to use the Inspector view, locate the JToggle buttons there and right-click on them.

EDIT: I missed the bit that you've created the bean yourself and then added it to the palette. In that case it is your's responsibility to add the desired events for the new bean.

kgiannakakis
You see in the inspector view a java bean is ONE unit.I cannot have access to the components inside
Argiropoulos Stavros