home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-07-24 | 2.3 KB | 68 lines |
- package borland.samples.tutorial.dataset.textdatafile;
-
- import java.awt.*;
- import java.awt.event.*;
- import borland.jbcl.control.*;
- import borland.jbcl.layout.*;
- import borland.jbcl.dataset.*;
-
- public class TextDataFileFrame extends DecoratedFrame {
- BorderLayout borderLayout1 = new BorderLayout();
- BevelPanel bevelPanel1 = new BevelPanel();
- StatusBar statusBar = new StatusBar();
- GridControl gridControl1 = new GridControl();
- NavigatorControl navigatorControl1 = new NavigatorControl();
- TableDataSet tableDataSet1 = new TableDataSet();
- TextDataFile textDataFile1 = new TextDataFile();
- GridBagLayout gridBagLayout1 = new GridBagLayout();
-
- //Construct the frame
- public TextDataFileFrame() {
- try {
- jbInit();
- }
- catch (Exception e) {
- borland.jbcl.util.Diagnostic.printStackTrace(e);
- }
- }
-
- //Component initialization
- public void jbInit() throws Exception{
- this.setLayout(borderLayout1);
- this.setTitle("TextDataFile tutorial");
- bevelPanel1.setLayout(gridBagLayout1);
- statusBar.setDataSet(tableDataSet1);
- gridControl1.setDataSet(tableDataSet1);
- navigatorControl1.setDataSet(tableDataSet1);
- tableDataSet1.setDataFile(textDataFile1);
- // textDataFile1.setFileName("C:\\JBuilder\\samples\\borland\\dataset\\TextDataFile\\employee.txt");
- textDataFile1.setFileName("employee.txt");
-
- gridControl1.addActionListener(new TextDataFileFrame_gridControl1_actionAdapter(this));
- this.add(statusBar, BorderLayout.SOUTH);
- this.add(bevelPanel1, BorderLayout.CENTER);
- bevelPanel1.add(gridControl1, new GridBagConstraints2(0, 1, 1, 1, 1.0, 1.0
- ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 3, 13, 0), -782, -654));
- bevelPanel1.add(navigatorControl1, new GridBagConstraints2(0, 0, 2, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(13, 3, 0, 3), 95, 0));
- }
-
-
- void gridControl1_actionPerformed(ActionEvent e) {
-
- }
- }
-
- class TextDataFileFrame_gridControl1_actionAdapter implements java.awt.event.ActionListener {
- TextDataFileFrame adaptee;
-
- TextDataFileFrame_gridControl1_actionAdapter(TextDataFileFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(ActionEvent e) {
- adaptee.gridControl1_actionPerformed(e);
- }
- }
-
-