I am using a JComboBox populated with a Vector. I want the text to be inset from the left edge of the box, at the moment it is tight to the left hand edge for a JTextField I have used Insets class FormJTextField extends JTextField { FormJTextField() { setFont( new Font( "Dialog", Font.BOLD, 16 )); setMargin(new Insets(4, 4, 4, 4)); } FormJTextField(String tipTxt) { setFont( new Font( "Dialog", Font.BOLD, 16 )); setMargin(new Insets(4, 4, 4, 4)); setToolTipText(tipTxt); } } how do I do this for a JComboBox?
When eating an Elephant take one bite at a time.<p>Ian...........
Anuradha Saravanamuthu
Greenhorn
Joined: Jan 27, 2002
Posts: 5
posted
0
Hi, Try with this combobox.setHorizondalalighnment(jlabel.right);
thanx & regards, S.A.Radha.
Ian Lockwood
Greenhorn
Joined: Aug 01, 2001
Posts: 22
posted
0
Thanks for that but the JComboBox does not have a setHorizontalAlignment method. The combobox is made up of three components a comboboxbutton a CellRendererPane and a JTextField, I have tried setting the margins for the JTextField and although this setting is set when I do println of the combobox it does not look any different. More help please :roll: