import java.awt.BorderLayout; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JTextField; import javax.swing.*; //import javax.swing.SwingUtilities; import java.awt.font.*; import java.awt.*; public class startURL { static JTextField theURL=new JTextField(); //Must be Static public static void main(String args[]) { JFrame frame = new JFrame("My Browser"); Font the_font = new Font("SansSerif", Font.BOLD, 24); theURL.setFont(the_font); theURL.setText("http://"); theURL.setCaretPosition(7); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JButton button = new JButton("<html><h3> Start a .jar from a URL </h3></html>"); button.addActionListener((e)->{ (new Thread(new JarRunner(theURL.getText().trim()))).start();}); JButton button1 = new JButton("<html><h3>Load a WebPage from a URL</h3></html>"); button1.addActionListener((e)->{ (new Thread(new MyBrowser(2,theURL.getText().trim()))).start();}); Container contentPane = frame.getContentPane(); contentPane.add(theURL, BorderLayout.CENTER); JPanel buttons=new JPanel(); buttons.add(button); buttons.add(button1); contentPane.add(buttons, BorderLayout.SOUTH); frame.setSize(750, 200); frame.setVisible(true); (new Thread(new MyBrowser(1,"http://www.umsl.edu/~siegelj/CS4010/testURLs.html"))).start(); } }