home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 4.0 KB | 102 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.
- */
-
- //Title: JBuilder Tutorial
- //Version: 2.0
- //Copyright: Copyright (c) 1998
- //Author: Jens Ole Lauridsen
- //Company: Borland Int'l
- //Description: Tutorial of Distributed Computing using RMI and DataSetData.
-
- package borland.samples.tutorial.dataset.datasetdata;
-
- import java.awt.*;
- import java.awt.event.*;
- import borland.jbcl.layout.*;
- import borland.jbcl.control.*;
- import java.util.*;
-
- // The DataServerFrame is the frame displayed by DataServerApp.
- // This file contains nothing relevant to the topic of this tutorial.
- //
- public class DataServerFrame extends DecoratedFrame {
- ResourceBundle res = Res.getBundle("borland.samples.tutorial.dataset.datasetdata.Res");
- borland.jbcl.control.ButtonControl buttonControl1 = new borland.jbcl.control.ButtonControl();
- borland.jbcl.control.TextControl textControl1 = new borland.jbcl.control.TextControl();
- borland.jbcl.control.TextControl textControl3 = new borland.jbcl.control.TextControl();
- java.awt.GridBagLayout gridBagLayout1 = new java.awt.GridBagLayout();
-
- public DataServerFrame(DataServerApp app) {
- this.app = app;
- try {
- jbInit();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
- private void jbInit() throws Exception{
- this.setResizable(false);
- this.setSize(new Dimension(408, 313));
- this.setTitle(res.getString("RS_ServerTitle"));
- this.addWindowListener(new java.awt.event.WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- this_windowClosing(e);
- }
- });
- buttonControl1.setLabel(res.getString("RS_CloseServer"));
- buttonControl1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(ActionEvent e) {
- buttonControl1_actionPerformed(e);
- }
- });
- textControl1.setText(res.getString("RS_Requests"));
- textControl3.setAlignment(borland.jbcl.util.Alignment.CENTER | borland.jbcl.util.Alignment.MIDDLE);
- textControl3.setText("0");
- this.setLayout(gridBagLayout1);
- this.add(buttonControl1, new GridBagConstraints2(1, 3, 3, 1, 0.0, 0.0
- ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(20, 20, 20, 20), 0, 0));
- this.add(textControl1, new GridBagConstraints2(1, 1, 3, 1, 1.0, 1.0
- ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(20, 20, 0, 20), 0, 0));
- this.add(textControl3, new GridBagConstraints2(1, 2, 3, 1, 1.0, 1.0
- ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 20, 0, 20), 0, 0));
- this.add(textControl2, new GridBagConstraints2(1, 0, 3, 1, 1.0, 1.0
- ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(20, 20, 5, 20), 0, 0));
- }
-
- void incrementUsage() {
- textControl3.setText(Integer.toString(++usage));
- }
-
- void buttonControl1_actionPerformed(ActionEvent e) {
- app.closing();
- System.exit(1);
- }
-
- void this_windowClosing(WindowEvent e) {
- app.closing();
- }
-
- private DataServerApp app;
- private int usage = 0;
- borland.jbcl.control.TextControl textControl2 = new borland.jbcl.control.TextControl();
- }
-
-