The component is JLabelcommonly used for short snippets of text. If you need to drop a large number of texts, you should use JTextArea. After that, you can wrap the text using setLineWrap :
Sets the line wrapping policy in the text area. If set to true, the lines will be wrapped if they are too long to fit in the selected width.
If you still want to use JLabel (not recommended), setting the label size should do the trick for you.
source
share