Is there a value that can be put into setBounds to set the width to the minimum needed?
JLabel title = new JLabel("Title Text");
title.setBounds(50, 20, ?, 13);
If you already know the text that will be in the
JLabel (i.e., if that text won't change after being assigned once), there is no need to set the minimum width; the
JLabel should do so automatically.