Java Reference
In-Depth Information
Figure 5-1: TableBuilderFrame generates SQL from table entries.
TableBuilderFrame is, in turn, built around a Jtable, which has been customized by adding
JComboBox components as column editors for such fields as DataType.
The method setCommandListener() is called by the MVC controller so that TableBuilderFrame
can pass the controller the generated SQL command when the Create Table button bar at the bottom
of the frame is pressed by the user.
Listing 5-8: TableBuilderFrame
package jdbc_bible.part2;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
/**
* TableBuilderFrame: a display which builds SQL CREATE statements
* <p/>
* TableBuilder, which extends JTable, is a key component.
*/
class TableBuilderFrame extends JInternalFrame{
protected int nRows = 15;
protected int nColumns = 6;
Search WWH ::




Custom Search