Posted by : Unknown Friday 19 June 2015

import javax.swing.*;
public class SimpleJLabelExample 
{
  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);
  }
}

Output:

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Translate

Popular Post

Total Pageviews

Blog Archive

- Copyright © Learning Java Program - Powered by Blogger -