Java tutorial
import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; public class Main { public static void main(String args[]) { JFrame f = new JFrame("Label Demo"); f.setLayout(new FlowLayout()); f.setSize(300, 200); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel label = new JLabel("java2s.com"); f.add(label); f.setVisible(true); } }