Java Reference
In-Depth Information
String menuSelection = event.getActionCommand();
if(menuSelection.equals("Database")){
selectDatabase();
}else if(menuSelection.equals("New Table")){
displayTableBuilderFrame();
}else if(menuSelection.equals("Drop Table")){
dropTable();
}else if(menuSelection.equals("Insert")){
displayTableEditFrame();
}else if(menuSelection.equals("Exit")){
System.exit(0);
}
}
}
class ExceptionListener implements ActionListener{
public void actionPerformed(ActionEvent event){
String exception = event.getActionCommand();
JOptionPane.showMessageDialog(null, exception,
"SQL Error", JOptionPane.ERROR_MESSAGE);
}
}
class CommandListener implements ActionListener{
public void actionPerformed(ActionEvent event){
String SQLCommand = event.getActionCommand();
executeSQLCommand(SQLCommand);
}
}
public static void main(String args[]){
DBManager dbm = new DBManager();
}
}
Search WWH ::




Custom Search