How can I create a custom JPanel with IntelliJ GUI designer? I created a new form and bound it to a custom class.
But TestingPanel is just a basic class.
public class TestingPanel {
private JButton button1;
public JPanel panel1;
private JButton button2;
private JButton button3;
}
now when I want to use JPanel I am forced to do something like this:
JPanel testingPanel = new TestingPanel().panel1;
I would expect that I can design my custom JPanel in GUI designer and than do advanced operations with it (adding listerners etc.) in code. Something like this:
public class TestingPanel extends JPanel {
private JButton button1;
private JButton button2;
private JButton button3;
public void onCreate() {
//change name, add listeners etc.
}
}
How can I do this? Thanks for any help.