Loading a file into a GUI
Hello there, i'm having real problems trying to implement a way for my GUI to load a file (in this case a text file) and then display the contents. I have used the following code to implement the part of the Menu to instigate this method, but I am unsure how to actually write the "openFile();" method to do the action.
JMenuItem openItem =new JMenuItem("Open");
openItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, SHORTCUT_MASK));
openItem.addActionListener(new ActionListener(){
publicvoid actionPerformed(ActionEvent e){ openFile();}
});
fileMenu.add(openItem);
Any help will be greatly appeciated.
cjr87.

