Hi. I have created 4 JLabels, and I want them to remain the same size when they are initialized and when data is put into them. My Labels start out with no text. I have tried both setPreferredSize() and setSize() to get the Labels to the size I want, but it doesn't work. When I put a long empty string in the text of the label, they are the size I want. However, once I set the text of them, if the text is not the same size of the label, it shortens the label.
Could someone please help me understand what I am doing wrong?
Thanks in advance!
Could someone please help me understand what I am doing wrong?
Thanks in advance!