void menuItem1_actionPerformed(ActionEvent e) { // Handle the File|New menu item. textArea1.setText(""); // clears the text of the TextArea }
To handle that, you'll have to set up infrastructure for reading and writing text files, for tracking whether the file has changed and needs saving, and so on. Let's begin the file support in the next step.