Java Reference
In-Depth Information
JMenuItem exitItem;
public TableMenu(){
setText("Table");
setActionCommand("Table");
setMnemonic((int)'T');
dbItem = new DBMenuItem("Database", 'D',itemListener,true);
newItem = new DBMenuItem("New Table",'T',itemListener,false);
openItem = new DBMenuItem("Drop Table",'D',itemListener,false);
exitItem = new DBMenuItem("Exit",'X',itemListener,true);
add(dbItem);
addSeparator();
add(newItem);
add(openItem);
addSeparator();
add(exitItem);
}
}
TableBuilderFrame
TableBuilderFrame is the heart of the MVC view. TableBuilderFrame extends
JInternalFrame, containing a JTable used to set up the fields for the database table, a
JTextArea , which provides a preview of the generated SQL command, and a Create Table button,
which fires an ActionEvent to the controller, sending it the generated SQL command.
Search WWH ::




Custom Search