I have a panel derived from JPanel. I have a custom control derived from JLabel. I am attempting to center this custom JLabel on my pa
JPanel
JLabel
BoxLayout is the way to go. If you set up a X_AXIS BoxLayout, try adding horizontal glues before and after the component:
panel.add(Box.createHorizontalGlue()); panel.add(label); panel.add(Box.createHorizontalGlue());