Anyone know why the error "Cannot make a static reference to the non-static method FileMenu() from the type Menu" appears?
import javax.swing.JOptionPane;
public class Menu {
public void FileMenu() {
}
public void ViewMenu() {
}
public static void main(String[] args) {
String[] mainbuttons = { "File", "View" };
int choice = JOptionPane.showOptionDialog(null, "Please Select An Option: ","Application Menu",JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null,mainbuttons, mainbuttons[2]);
switch (choice) {
case 0:
FileMenu();
break;
case 1:
ViewMenu();
break;
}
}
}