I'm trying to create a custom component in NetBeans which contains 2 buttons on a panel.
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JPanel;
public class CustomComponent extends JPanel {
JButton button1 = new JButton("Button 1");
JButton button2 = new JButton("Button 2");
public CustomComponent() {
setLayout(new FlowLayout());
add(button1);
add(button2);
button1.setSize(100, 30);
button2.setSize(100, 30);
}
}
When I use this custom component on another project's JFrame (using GUI designer), those two buttons need to have two different ActionPerformed
events and those events must be shown in the Netbean's event list. is that possible to do?
(Currently, I only see the events owned by the JPanel.)
Thanks in advance