Tagged: JLabel

JLabel -example 0

Creating a JLabel with Text Example

Below code creates a Simple JLabel with Text Example using JLabel() constructor method.Note that JLabel class has several methods.   /** * * @author Eric * Email:kawi3462@gmail.com * Site:www.techoverload.net */ import java.awt.FlowLayout; import javax.swing.JFrame;...

ImageIcon 0

Add ImageIcon to a JLabel and center it

/** * * @author Eric * Email:kawi3462@gmail.com * Site:www.techoverload.net */ import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.ImageIcon; public class JLabelImageIcon extends JFrame { public JLabelImageIcon() { super("JLabel with Image Icon Example"); setSize(400,400); setLayout(new...

Java JLabel setBorder() Method Example 0

Java JLabel setBorder () Method Example

Below code shows how to use Java JLabel setBorder ()  Method Example import java.awt.Color; import java.awt.FlowLayout; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JLabel; /** * * @author acer */ public class JLabelExample { JLabelExample(){ JFrame frame=new JFrame();...

Jlabel-getText-method 0

Java JLabel getText and JTextField setText methods

Below code shows how to use JLabel getText method and JTextField setText method. import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; public class JLabelExample extends JFrame { JLabelExample() { super(“JLabel Example”); setLayout(new FlowLayout()); JLabel label=new...

How to create a simple JLabel with Text 0

How to create a simple JLabel with Text

Below code shows how to create a simple JLabel with Text.   import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; public class JLabelExample extends JFrame { JLabelExample() { super(“JLabel Example”); JLabel label=new JLabel(“JLabel with Text”); add(label);...