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. import javax.swing.* ; import java.awt.*; import java.awt.event.*; public class JLabelDemo3 extends JFrame { …

JLabel Example Multiline Text Java Swing Read More »

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. import javax.swing.* ; import java.awt.*; import java.awt.event.*; public class JLabelDemo2 extends JFrame { public JLabelDemo2() { Container c = getContentPane(); c.setLayout(new GridLayout(3, 1, 0, 10)); // ordinary text like Label of …

JLabel Border and Image Example Read More »