import javax.swing.*; import java.io.*; import java.awt.*; import java.awt.event.*; public class TrackerGUI extends JFrame implements ActionListener{ private DrawingPanel pnl = new DrawingPanel(); private JTextField txt = new JTextField(20); public TrackerGUI() { super("Enter File Name"); // will go in title bar setLocation(100,100); setSize(500,500); txt.setBackground(Color.lightGray); // for inputting path data file txt.addActionListener(this); // ...will pass control to // actionPerformed when Enter is hit // in the text field Container c = getContentPane(); c.add(txt,"North"); c.add(pnl,"Center"); setDefaultCloseOperation(EXIT_ON_CLOSE); setVisible(true); } public void actionPerformed(ActionEvent e) { String s = txt.getText(); // control goes here when Enter is hit // get file name for path txt.setText(""); // reset text field to empty pnl.processPath(s); // draw the path of the hurricane } public static void main( String [] args) { TrackerGUI gui = new TrackerGUI(); } }