01: /*
02: * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.instance.common.listener;
07:
08: //
09:
10: import com.sun.portal.config.context.DebugContext;
11:
12: import java.awt.*;
13: import java.awt.event.*;
14:
15: //
16:
17: public class TextFieldListener extends FocusAdapter implements
18: ActionListener, TextListener {
19: //
20: protected String tft = null;
21:
22: public TextFieldListener(String initialText) {
23: tft = initialText;
24: DebugContext.message("TextField text initialized to <" + tft
25: + ">");
26: }
27:
28: //
29: //
30: //
31: public void actionPerformed(ActionEvent e) {
32: TextField tf = (TextField) e.getSource();
33: tft = tf.getText();
34: DebugContext.message("TextField text is <" + tft + ">");
35: }
36:
37: public void focusLost(FocusEvent e) {
38: TextField tf = (TextField) e.getSource();
39: tft = tf.getText();
40: DebugContext.message("TextField text is <" + tft + ">");
41: }
42:
43: public void textValueChanged(TextEvent e) {
44: TextField tf = (TextField) e.getSource();
45: tft = tf.getText();
46: DebugContext.message("TextField text is <" + tft + ">");
47: }
48:
49: public String getTextFieldText() {
50: return tft;
51: }
52:
53: //
54: //
55: //
56: }
|