import javax.swing.*;        
import java.awt.*;

public class HelloWorld {

    public static void main(String[] args) {

	javax.swing.SwingUtilities.invokeLater(new Runnable() {
   		 public void run() {
       	 /* create and show the GUI */ 
			mygui();
		}
    	  });
   }

   public static void mygui () {
        JFrame.setDefaultLookAndFeelDecorated(true);
        JFrame frame = new JFrame("HelloWorldSwing");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JLabel label[];
	label = new JLabel[10];
	Container pane;
	pane = frame.getContentPane();
	pane.setLayout (new GridLayout(0,3));
	for (int i=0; i<10; i++) {
		label [i] = new JLabel("Hello World " + String.valueOf(i) );
	        pane.add(label[i]);
        	frame.pack();
        	frame.setVisible(true);
	}
    }
}

