Back with more code and more questions:
JButton Save = new JButton("Save New Map");
Save.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFileChooser chooserS = new JFileChooser();
int returnVal = chooserS.showSaveDialog(null);
if(returnVal == JFileChooser.APPROVE_OPTION){
File filr =chooserS.getSelectedFile();
log.append("Saving:" + filr.getName() + "." + "\n");
}else{
log.append("Save command cancelled by user");
}
log.setCaretPosition(log.getDocument().getLength());
}
});
1st question --- Why does sun use JTextArea for log? I dont get it.
2nd question --- log.append("Saving:" + filr.getName() + "." + "\n"); why is here the \n ?? I can't select the extension like this.
So how can I select the extension????