home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / jbuilder / jsamples.z / TextDataFileFrame.java < prev    next >
Encoding:
Java Source  |  1997-07-24  |  2.3 KB  |  68 lines

  1. package borland.samples.tutorial.dataset.textdatafile;
  2.  
  3. import java.awt.*;
  4. import java.awt.event.*;
  5. import borland.jbcl.control.*;
  6. import borland.jbcl.layout.*;
  7. import borland.jbcl.dataset.*;
  8.  
  9. public class TextDataFileFrame extends DecoratedFrame {
  10.   BorderLayout borderLayout1 = new BorderLayout();
  11.   BevelPanel bevelPanel1 = new BevelPanel();
  12.   StatusBar statusBar = new StatusBar();
  13.   GridControl gridControl1 = new GridControl();
  14.   NavigatorControl navigatorControl1 = new NavigatorControl();
  15.   TableDataSet tableDataSet1 = new TableDataSet();
  16.   TextDataFile textDataFile1 = new TextDataFile();
  17.   GridBagLayout gridBagLayout1 = new GridBagLayout();
  18.  
  19.   //Construct the frame
  20.   public TextDataFileFrame() {
  21.     try {
  22.       jbInit();
  23.     }
  24.     catch (Exception e) {
  25.       borland.jbcl.util.Diagnostic.printStackTrace(e);
  26.     }
  27.   }
  28.  
  29.   //Component initialization
  30.   public void jbInit() throws Exception{
  31.     this.setLayout(borderLayout1);
  32.     this.setTitle("TextDataFile tutorial");
  33.     bevelPanel1.setLayout(gridBagLayout1);
  34.     statusBar.setDataSet(tableDataSet1);
  35.     gridControl1.setDataSet(tableDataSet1);
  36.     navigatorControl1.setDataSet(tableDataSet1);
  37.     tableDataSet1.setDataFile(textDataFile1);
  38. //  textDataFile1.setFileName("C:\\JBuilder\\samples\\borland\\dataset\\TextDataFile\\employee.txt");
  39. textDataFile1.setFileName("employee.txt");
  40.  
  41.     gridControl1.addActionListener(new TextDataFileFrame_gridControl1_actionAdapter(this));
  42.     this.add(statusBar, BorderLayout.SOUTH);
  43.     this.add(bevelPanel1, BorderLayout.CENTER);
  44.     bevelPanel1.add(gridControl1, new GridBagConstraints2(0, 1, 1, 1, 1.0, 1.0
  45.             ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 3, 13, 0), -782, -654));
  46.     bevelPanel1.add(navigatorControl1, new GridBagConstraints2(0, 0, 2, 1, 1.0, 0.0
  47.             ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(13, 3, 0, 3), 95, 0));
  48.   }
  49.  
  50.   
  51.   void gridControl1_actionPerformed(ActionEvent e) {
  52.  
  53.   }
  54. }
  55.  
  56. class TextDataFileFrame_gridControl1_actionAdapter implements java.awt.event.ActionListener {
  57.   TextDataFileFrame adaptee;
  58.  
  59.   TextDataFileFrame_gridControl1_actionAdapter(TextDataFileFrame adaptee) {
  60.     this.adaptee = adaptee;
  61.   }
  62.  
  63.   public void actionPerformed(ActionEvent e) {
  64.     adaptee.gridControl1_actionPerformed(e);
  65.   }
  66. }
  67.  
  68.