import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MoreComplexGUI
{
	public MoreComplexGUI()
	{
		JDialog dialog = new JDialog();
		JPanel  panel  = new JPanel();
		JLabel  label1 = new JLabel("Hello");
		JLabel  label2 = new JLabel("Everybody"); 
	
		panel.add(label1);
		panel.add(label2);
		dialog.getContentPane().add(panel);
		dialog.setTitle("Another Exciting Example");
		dialog.setSize(300,200);
		dialog.setVisible(true);
	
		// exit the application cleanly
		dialog.addWindowListener(new WindowAdapter()
		{
			public void windowClosing(WindowEvent evt)
			{
				System.exit(0);
			}
		});
	}
	public static void main(String[] argv)
	{
		MoreComplexGUI mcg = new MoreComplexGUI();
	}
}
