The usual approach is to not use JLabel and instead use JTextArea with word wrap and wrapper enabled. Then you can decorate JTextArea so that it looks like JLabel (border, background color, etc.). [Edited to include line ending for completeness on DSquare comment]
Another approach is to use HTML in your shortcut, like here. . Fears there
You may need to take care of some characters that HTML can interpret / convert from plain text.
The call to myLabel.getText() will now contain HTML (possibly escaped and / or converted characters due to # 1
EDIT: Here is an example JTextArea approach:

import javax.swing.*; public class JLabelLongTextDemo implements Runnable { public static void main(String args[]) { SwingUtilities.invokeLater(new JLabelLongTextDemo()); } public void run() { JLabel label = new JLabel("Hello"); String text = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
source share