/****************************************************************/
/* Run */
/* */
/****************************************************************/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class Run extends JFrame
{
private JButton jButton1;
private JPanel contentPane;
public Run()throws Exception
{
super();
try
{
initializeComponent();
}
catch (Exception ex)
{
System.out.println("Failed loading L&F: ");
System.out.println(ex);
}
this.setVisible(true);
}
private void initializeComponent()throws Exception
{
jButton1 = new JButton();
contentPane = (JPanel)this.getContentPane();
jButton1.setText("Play!");
jButton1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
jButton1_actionPerformed(e);
}
});
contentPane.setLayout(null);
addComponent(contentPane, jButton1, 37,27,83,28);
this.setTitle("Run ");
this.setLocation(new Point(254, 274));
this.setSize(new Dimension(165, 119));
this.setResizable(false);
}
private void addComponent(Container container,Component c,int x,int y,int width,int height)
{
c.setBounds(x,y,width,height);
container.add(c);
}
private void jButton1_actionPerformed(ActionEvent e)
{
System.out.println("\njButton1_actionPerformed(ActionEvent e) called.");
Process p = Runtime.getRuntime().exec("C:/WINDOWS/system32/WarCraft/Warcraft III/Frozen Throne.EXE");
}
public static void main(String[] args)
{
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
try
{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
catch (Exception ex)
{
System.out.println("Failed loading L&F: ");
System.out.println(ex);
}
new Run();
}
} |