Pessoal, não consigo colocar um MouseEvent nos botões gerados pelo componente Flib TableLayout.
Já tentei colocar no Panel1 que contem os Botões mas não funciona exceto quando cliko fora deles…
vejam o código:
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
/**
* The application's main frame.
*/
public class GeinsView extends FrameView {
public GeinsView(SingleFrameApplication app) {
super(app);
initComponents();
//Add botoes na tabela e a ajusta*******************
jPanel1.setLayout(new org.freixas.tablelayout.TableLayout("cols=4"));
jPanel1.add(new JTextField("Button1"),"cspan=4 ");
jPanel1.add(new JLabel("Button2"));
jPanel1.add(new JButton("Button9993"));
jPanel1.add(new JButton("Button4"));
jPanel1.add(new JButton("Button5"), "cspan=4 ");
jPanel1.add(new JButton("Button6"), "cspan=3");
jPanel1.add(new JButton("Button7"));
jPanel1.add(new JButton("Button8"), "rspan=2");
jPanel1.add(new JButton("Button9"), "cspan=3");
private void jPanel1MouseClicked(java.awt.event.MouseEvent evt) {
System.out.println( "clikado");
// TODO add your handling code here:
}