01: package testportlet;
02:
03: import java.awt.event.ActionEvent;
04: import java.awt.event.ActionListener;
05:
06: import org.wings.SButton;
07: import org.wings.SForm;
08: import org.wings.SFrame;
09: import org.wings.SGridLayout;
10: import org.wings.SLabel;
11: import org.wings.STextField;
12:
13: public class TestPortletWingSEdit {
14:
15: public TestPortletWingSEdit() {
16:
17: // Erstellung der HTML-Form mit einem GridLayout
18: SGridLayout gridLayout = new SGridLayout(1);
19: SForm panel = new SForm(gridLayout);
20: SButton submitButton = new SButton("Submit");
21: gridLayout.setVgap(10);
22:
23: final SLabel message = new SLabel();
24: final STextField textField = new STextField();
25:
26: // ActionListener für den Button
27: submitButton.addActionListener(new ActionListener() {
28: public void actionPerformed(ActionEvent e) {
29: message.setText("Hallo " + textField.getText() + " !");
30: }
31: });
32:
33: panel.add(new SLabel(
34: "Currently in edit mode, please insert name:"));
35: panel.add(textField);
36: panel.add(submitButton);
37: panel.add(message);
38:
39: SFrame rootFrame = new SFrame();
40: rootFrame.getContentPane().add(panel);
41: rootFrame.setVisible(true);
42:
43: }
44:
45: }
|