home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / jbuilder / jsamples.z / MasterDetailApplication1.java < prev    next >
Text File  |  1997-07-03  |  855b  |  28 lines

  1. package borland.samples.tutorial.dataset.masterdetail;
  2.  
  3. import java.awt.*;
  4.  
  5. public class MasterDetailApplication1 {
  6.  
  7.   //Construct the application
  8.   public MasterDetailApplication1() {
  9.     MasterDetailFrame1 frame = new MasterDetailFrame1();
  10.     frame.pack();
  11.     //Center the window
  12.     Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  13.     Dimension frameSize = frame.getPreferredSize();
  14.     if (frameSize.height > screenSize.height)
  15.       frameSize.height = screenSize.height;
  16.     if (frameSize.width > screenSize.width)
  17.       frameSize.width = screenSize.width;
  18.     frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
  19.     frame.setVisible(true);
  20.   }
  21.  
  22.   //Main method
  23.   static public void main(String[] args) {
  24.     new MasterDetailApplication1();
  25.   }
  26. }
  27.  
  28.