jlabel border

JLabel Example Multiline Text Java Swing

One of the important features of JLabel is it can be displayed as multiple lines of text with bullets, a very contrast of AWT Label which gives only one line of text. We use HTML here. Following code on JLabel Example explains.

Output screen on JLabel Example lab4.setBorder(BorderFactory.createTitledBorder(“Multi-Line HTML”));…

JLabel Border and Image Example

Swing Label can be set with borders and images which is not possible with AWT Label component. Alignment is also possible. Following code explains.

There are three labels in the above output screen, lab1, lab2 and lab3. JLabel lab1 = new JLabel(“Ordianry Test”); lab1 comes with simple test like…