Posted by : Unknown
Friday, 19 June 2015
import javax.swing.*;
public class SimpleJLabelExample
public class SimpleJLabelExample
{
public static void main(String[] args)
public static void main(String[] args)
{
JLabel label = new JLabel("A Very Simple Text Label");
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(label); // adds to CENTER
frame.pack();
frame.setVisible(true);
}
}
JLabel label = new JLabel("A Very Simple Text Label");
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(label); // adds to CENTER
frame.pack();
frame.setVisible(true);
}
}
Output:
Related Posts :
- Back to Home »
- Example program , Simple Program »
- Simple Text Label