//package jex;

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

public class Jex {
	public static void main( final String s[] )
	{
		if( s.length == 0 || ( !s[ 0 ].equals( "true" ) && !s[ 0 ].equals( "false" ) ) )
		{
			System.out.println( "Argument must be true/false for setUndecorated" );
			return;
		}


		javax.swing.SwingUtilities.invokeLater(
			new Runnable()	
			{
				public void run() {
					JFrame frame = new JFrame("JEX");
					frame.setUndecorated( s[ 0 ].equals( "true" ) );
            
					JPanel panel = new JPanel();
					panel.setLayout(new FlowLayout());
            
					JLabel label = new JLabel("This is a label!");
            
					JButton button = new JButton();
					button.setText("Press me");
            
					panel.add(label);
					panel.add(button);
            
					frame.add(panel);
					frame.setSize(300, 300);
					frame.setLocationRelativeTo(null);
					frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
					frame.setVisible(true);
				}
			}
		);
	}
}
