posted 15 years ago
Hi ALl,
How to add components from the top of the JPanel using GridBagLayout?
I hope by default it starts from the centre.
Here is my code.
JPanel panel = new JPanel();
GridBagLayout gbl = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
panel.setLayout(gbl);
priceButton = new JButton();
panel.add(priceButton);
I tried diff options but it didnt work.
Thanks in advance.
Regards,
Kannan Somaiah