home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 2.0 KB | 57 lines |
- /*
- * Copyright (c) 1997-1998 Borland International, Inc. All Rights Reserved.
- *
- * This SOURCE CODE FILE, which has been provided by Borland as part
- * of a Borland product for use ONLY by licensed users of the product,
- * includes CONFIDENTIAL and PROPRIETARY information of Borland.
- *
- * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS
- * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
- * THE PRODUCT.
- *
- * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
- * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
- * OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
- * OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
- * OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
- * OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
- * CODE FILE.
- */
- package borland.samples.tutorial.dataset.locator;
-
- import java.awt.*;
- import com.sun.java.swing.UIManager;
-
- // Application Class
- public class Locator
- {
- // main application Frame
- LocatorFrame frame1;
-
- void init() throws Exception {
- frame1 = new LocatorFrame();
- frame1.pack();
- frame1.setVisible(true);
-
- //Center the window
- Dimension dimScreen = Toolkit.getDefaultToolkit().getScreenSize();
- Dimension dimFrame = frame1.getPreferredSize();
- if(dimFrame.height > dimScreen.height) dimFrame.height = dimScreen.height;
- if(dimFrame.width > dimScreen.width) dimFrame.width = dimScreen.width;
- frame1.setBounds( (dimScreen.width - dimFrame.width) / 2, (dimScreen.height - dimFrame.height) / 2, dimFrame.width, dimFrame.height);
- }
-
- public static void main(String args[]) {
- Locator app = new Locator();
- try {
- UIManager.setLookAndFeel(new com.sun.java.swing.plaf.windows.WindowsLookAndFeel());
- //UIManager.setLookAndFeel(new com.sun.java.swing.plaf.motif.MotifLookAndFeel());
- app.init();
- }
- catch (Exception x) {
- // handle exceptions here
- }
- }
- }
-
-