NewProductPanel pPanel=new NewProductJPanel();
pPanel.setVisible(true);
mainPanel.setLayout(new java.awt.BorderLayout());
mainPanel.add(pPanel);
i have created a jPanel form and i want to add it dynamically to my program’s mainJFrame, i am using NetBeans..plz help me regarding this..
First, don’t call
setVisibleon pPanel, call it on mainPanel. Also, you may need to callrevalidateon mainPanel.