JLabel centering

58 Views Asked by At

I have a JFrame which contains a JPanel, in the JPanel I have multiple JTextField and JLabel components. My text fields are already centered by setting their bounds, but how can I center my label's texts horizontally and change the vertical location of each label? Or how can I use FontMetrics to get the string width so I can center them manually by setting their bounds?

0

There are 0 best solutions below