how to set the cell size in grid layout where each cell is a panel
843807Mar 23 2006 — edited Jun 6 2006Hi,
I am using a grid layout where each cell is a panel. Here I want to
set size of each panel to be equal irrespective of any. But it is not obliging the setSize().
no of row in grid - 4
no of columns - 4
each cell is a panel. each panel has a label.
panel.setSize(parent.getWidth(), parent.getWidth()/4); // not working. Size is adjusting to the length of the label.
I want to force the size of the panel to our preferred size.
Note: In swing we can use JPanel.setPreferredSize(). Unfortunately I cannot use Swing components. Requirement is awt only.
Any help in this is highly appreciated.
Thanks
Kishore