I have Added two JPanels into a JPanel with GridBagLayout. Now the issue is :
When the main panel loads it shows the upper panel bit above the actual place it should be and when data from db loads into the JTextfields and JComboBox then panel goes to its actual size.
sample code:
public class JPanelIssue extends JPanel { public JPanelIssue() { JPanel mainPanel = new JPanel(new GridBagLayout()); JPanel panel1 = new JPanel(); JPanel panel2 = new JPanel(); mainPanel.add(panel1, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.6, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(panel2, new GridBagConstraints(0, 1, 1, GridBagConstraints.REMAINDER, 1.0, 0.4,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); add(mainPanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); } } panel1 contains fields related to search criteria and panel2 contains JTable dispalying reults.
Is there any problem of AWT event queue or any other problem?
Thanks in advance.