How do i change the position of the text in JCheckbox. I want the text to be on the left of the check box and not as default on the right. i been over the jcheckbox, jtooglebutton and jabstractButton api few times.
jCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);
It's actually inherited from AbstractButton, but you can find this also for JLabels (in this case, it's relative to the icon you may use in the label).
Now this is assuming you want just a particular change on this one component. If your goal is to reverse the direction of all components in your application (for example for a right to left reading), you should probably look into component orientation, with the setComponentOrientation and applyComponentOrientation methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With