Hai Experts , I need some suggestions for the below scenario, my screen has two panels one is in left side & another is in right side of the screen.while opening the main screen I am having 3 buttons on the left side panel and none in the right side panel.If i clicked the 1st button 2 labels,2 text fields and 2 buttons should be displayed on the right side panel.I am having these components in a separate class file which extends a JPanel.Only in the run time i want to add this class file(as component) to the right side panel in the main screen.
Can any one guide how to make it possible?
How are you dividing the left and right sides of your frame?Are you using JSplitPane?
Essentially what you need to do is add a listener to the buttons on the left panel. When the button is clicked, you need to set the appropriate panel to the right hand side.
Check out the JTabbedPane API on how to add/remove components.