JLabel label = new JLabel ("test");
My first problem is I can't get the label to show up with an empty constructor so I have to put a string in it. My code sets the label text dynamically later on but it won't display unless a string value is put in the constructor first.
I center it using
label.setAlignmentX(JPanel.CENTER_ALIGNMENT);
When I change the text later dynamically to some longer text, it still looks centered, but only the first couple letters show up followed by "...". So when I try to change the text to "Solved!" it ends up showing "S..."
I've tried changing the size using label.setSize(100, 50); No luck.
Any ideas how to fix these two problems?

New Topic/Question
Reply




MultiQuote








|