1 5 package com.opensymphony.webwork.example.client; 6 7 import java.awt.*; 8 9 import javax.swing.*; 10 11 12 17 public class DemoResult extends JPanel { 18 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 32 public DemoResult() { 33 try { 34 jbInit(); 35 } catch (Exception ex) { 36 ex.printStackTrace(); 37 } 38 } 39 40 42 46 public void setInput(JTextField newInput) { 47 input = newInput; 48 } 49 50 54 public JTextField getInput() { 55 return input; 56 } 57 58 62 public void setInvocationNumber(JTextField newInvocationNumber) { 63 invocationNumber = newInvocationNumber; 64 } 65 66 70 public JTextField getInvocationNumber() { 71 return invocationNumber; 72 } 73 74 78 public JTextArea getMessages() { 79 return messages; 80 } 81 82 86 public void setOutput(JTextField newOutput) { 87 output = newOutput; 88 } 89 90 94 public JTextField getOutput() { 95 return output; 96 } 97 98 void jbInit() throws Exception { 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 |