Java Utililty Methods JMenuBar

List of utility methods to do JMenuBar

Description

The list of methods to do JMenuBar are organized into topic(s).

Method

StringselectSaveFile(JMenuBar menuBar)
select Save File
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Specify a file to save");
int userSelection = fileChooser.showSaveDialog(menuBar);
if (userSelection == JFileChooser.APPROVE_OPTION) {
    File fileToSave = fileChooser.getSelectedFile();
    System.out.println("Save as file: " + fileToSave.getAbsolutePath());
    return fileToSave.getAbsolutePath();
return "";