tom_corc
asked on
JCheckBox - align text on left
I have a JCheckbox for which I want the label or caption on the left and the checkbox on the right. I have tried using the setAlignmentX, setHorizontalAlignment and setHorizontalTextPosition methods but they don't seem to work. Does anyone have any sample code for this ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked - Thanks
JPanel checkBoxPanel = new JPanel(new GridLayout(1,2));
JCheckBox myCheck = new JCheckBox();
checkBoxPanel.add(new JLabel("My CheckBoxText"));
checkBoxPanel.add(myCheck)
Sorry I couldn't be more help
Kylar