KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > helloworld > listeners > HelloWorld_li


1 /*******************************************************************************
2  * Copyright (c) 2004, Dirk von der Weiden.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * Dirk von der Weiden - initial API and implementation
10  *
11  * Created on 14.06.2004
12  *
13  * date: 14.06.2004
14  * project: WiSer-HelloWorld
15  *
16  * *******************************************************************************/

17
18 package helloworld.listeners;
19
20 import Jmc.baseGui.*;
21 import Jmc.baseTools.*;
22 import Jmc.commonGui.*;
23
24 /**
25  * @author Dirk
26  *
27  * date: 14.06.2004
28  *
29  * <p>
30  * Purpose: This listener reads the value from the input field and displays this value and
31  * an aditional "Hello" String below the input field.
32  * </p>
33  */

34 public class HelloWorld_li implements base_guiListener
35 {
36     /**
37          * <p>
38          * This method is called whenever the button is pressed.
39          * </p><p>
40          *
41          * </p><p>
42          * @param xParam the widget which generates the event
43          * </p>
44          */

45     public void pcmf_execListener(base_guiObj xParam) throws Exception JavaDoc
46     {
47     // Get the widget from the XML configuration
48
base_text_if l_txt = (base_text_if)base_registredObject.pcmf_getObjByName("mylabel");
49     base_inputField_if l_inp = (base_inputField_if)base_registredObject.pcmf_getObjByName("myinput");
50     
51     // Copy value
52
l_txt.pcmf_setValue("Hello " + l_inp.pcmf_getValue());
53     
54     // Do a repaint to ensure that everything is displayed correctly
55
l_txt.pcmf_repaint();
56     
57     // Thats it
58
return;
59     }
60 }
61
Popular Tags