|
HTML formatted multiline JLabel |
Jlabel is actually intended to show single line of text. But you may sometimes ask how to make
JLabel to display multiline text. It is possible for JLabel to show multiple lines of text. JLabel in Java can show HTML formatted text. This ability of JLabel can be used to extend longer text onto next line. The following lines of code is an answer for the questions like 'is there a multi-line JLabel' or 'how to display multiple lines using JLabel. Simply, look at the sample code:
JLabel lbl_Multiline=new JLabel();
lbl_Multiline.setText("<html>This is my long text to display with JLabel....</html>");
|