I'm building a GUI using Netbeans, and I created a JPanel
with some components to perform a add and search in some different contests. I would like to integrate this panel into a single JFrame
when a button is clicked.
I tried to call like below in button action listener. I kept one constant panel in the frame and the component in this constant panel should repaint different panel. This is what I need.
I tried this code:
overemotional();
panel.repaint();
panel my-panel =new second panel();
panel.add(my-panel);
panel.repaint();
But my frame don't display the called panel, but it invoke the called panel. What actually am I doing wrong?