KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > example > client > DemoResult


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.example.client;
6
7 import java.awt.*;
8
9 import javax.swing.*;
10
11
12 /**
13  * Result panel object for the client dispatcher example
14  * @author Peter Kelley
15  * @version 1.0
16  */

17 public class DemoResult extends JPanel {
18     //~ Instance fields ////////////////////////////////////////////////////////
19

20     GridBagLayout gridBagLayout1 = new GridBagLayout();
21     JLabel jLabel1 = new JLabel();
22     JLabel jLabel2 = new JLabel();
23     JLabel jLabel3 = new JLabel();
24     JLabel jLabel5 = new JLabel();
25     JTextArea messages = new JTextArea();
26     JTextField input = new JTextField();
27     JTextField invocationNumber = new JTextField();
28     JTextField output = new JTextField();
29
30     //~ Constructors ///////////////////////////////////////////////////////////
31

32     public DemoResult() {
33         try {
34             jbInit();
35         } catch (Exception JavaDoc ex) {
36             ex.printStackTrace();
37         }
38     }
39
40     //~ Methods ////////////////////////////////////////////////////////////////
41

42     /**
43      * Setter for property input.
44      * @param newInput the new value for field input
45      */

46     public void setInput(JTextField newInput) {
47         input = newInput;
48     }
49
50     /**
51      * Getter for property input.
52      * @return the value of field input
53      */

54     public JTextField getInput() {
55         return input;
56     }
57
58     /**
59      * Setter for property invocationNumber.
60      * @param newInvocationNumber the new value for field invocationNumber
61      */

62     public void setInvocationNumber(JTextField newInvocationNumber) {
63         invocationNumber = newInvocationNumber;
64     }
65
66     /**
67      * Getter for property invocationNumber.
68      * @return the value of field invocationNumber
69      */

70     public JTextField getInvocationNumber() {
71         return invocationNumber;
72     }
73
74     /**
75      * Getter for property messages.
76      * @return the value of field messages
77      */

78     public JTextArea getMessages() {
79         return messages;
80     }
81
82     /**
83      * Setter for property output.
84      * @param newOutput the new value for field output
85      */

86     public void setOutput(JTextField newOutput) {
87         output = newOutput;
88     }
89
90     /**
91      * Getter for property output.
92      * @return the value of field output
93      */

94     public JTextField getOutput() {
95         return output;
96     }
97
98     void jbInit() throws Exception JavaDoc {
99         jLabel1.setText("Result of Invocation Number:");
100         this.setLayout(gridBagLayout1);
101         jLabel2.setText("Input:");
102         jLabel3.setText("Output:");
103         invocationNumber.setText("");
104         input.setText("");
105         output.setText("");
106         jLabel5.setText("Messages:");
107         this.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 5, 5, 5), 0, 0));
108         this.add(jLabel2, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 5, 5, 5), 0, 0));
109         this.add(jLabel3, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 5, 5, 5), 0, 0));
110         this.add(invocationNumber, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 10), 0, 0));
111         this.add(input, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 10), 0, 0));
112         this.add(output, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 10), 0, 0));
113         this.add(messages, new GridBagConstraints(1, 4, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 10), 0, 0));
114         this.add(jLabel5, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 10), 0, 0));
115     }
116 }
117
Popular Tags