It's been awhile since I asked a question!
I'm developing an application in Java where JLabels
are used. Anyway, as you may or may not be able to see from the picture below, the text that says Category Test
gets cut off and ends up saying Categor...
instead. Is there any way that I can "break" the text once it fills up the width of the label? Here is the image:
What I did
I used a JTextPane like so:
JTextPane text = new JTextPane();
SimpleAttributeSet attr = new SimpleAttributeSet();
StyleConstants.setAlignment(attr, StyleConstants.ALIGN_CENTER);
pane.add(text, c);
Then I added my text, but thanks anyway!