Rob Spoor wrote:Please UseCodeTags next time. I've added them for you this time.
harshi Sum wrote:I want to set size of the "combobox" , because it appears too large and very ugly. (Actually i want to arrange the things in a proper manner that it would look nice).
I have tried with "setMinimumSize" and "setSize". But it seems the grid layout is ignoring them.
Almost all layout managers ignore the value returned by getSize(). Instead they use the value returned by getPreferredSize(). getMinimumSize() and getMaximumSize() may also be used but only to determine the maximum bounds for components. You'll need to call setPreferredSize instead.
There is a but though. GridLayout uses getPreferredSize() of all the components to calculate the grid cell size. This is then the maximum of all preferred widths by the maximum of all preferred heights. So if you have another component that is longer or higher than your combo box then your combo box will still be stretched. To prevent this, either don't use GridLayout, or put the combo box in a JPanel that you put in your applet. This JPanel can keep its default FlowLayout.