Source code: javatools/awt/event/SetTextEvent.java
1 /*
2 * SetTextEvent.java
3 *
4 * Created on 11 gennaio 2003, 19.08
5 Javatools (modified version) - Some useful general classes.
6 Copyright (C) 2002-2003 Chris Bitmead (original) Antonio Petrelli (modified)
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 Contact me at: brenmcguire@users.sourceforge.net
23 */
24
25 package javatools.awt.event;
26
27 import java.awt.ActiveEvent;
28 import java.awt.AWTEvent;
29 import javatools.db.DbRow;
30 import javatools.util.DbRowUser;
31
32 /** Event to set a JLabel's text in the event queue.
33 * @author Antonio Petrelli
34 * @version 0.1.8
35 */
36 public class SetTextEvent extends AWTEvent implements ActiveEvent {
37
38 /**
39 * Marks the first integer id for the range of invocation event ids.
40 */
41 public static final int INVOCATION_FIRST = 1200;
42
43 /**
44 * The default id for all InvocationEvents.
45 */
46 public static final int INVOCATION_DEFAULT = INVOCATION_FIRST;
47
48 /**
49 * Marks the last integer id for the range of invocation event ids.
50 */
51 public static final int INVOCATION_LAST = INVOCATION_DEFAULT;
52
53 /** Creates a new SetTextEvent.
54 * @param source The object that generated the event.
55 * @param pLabel The label to use.
56 * @param pText The string to put into the label.
57 */
58 public SetTextEvent(Object source, javax.swing.JLabel pLabel, String pText) {
59 super(source, INVOCATION_DEFAULT);
60 label = pLabel;
61 text = pText;
62 }
63
64 /** Dispatches the event.
65 */
66 public void dispatch() {
67 label.setText(text);
68 }
69
70 private javax.swing.JLabel label;
71 private String text;
72 }