KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > neu > ccs > jmk > awt > MakeInput


1 // $Id: MakeInput.java,v 1.2 2001/12/07 11:41:24 ramsdell Exp $
2

3 // A text field for the make window.
4

5 /*
6  * Copyright 1997 by John D. Ramsdell
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (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 Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23 package edu.neu.ccs.jmk.awt;
24
25 import java.awt.*;
26 import java.awt.event.*;
27
28 /**
29  * A text field for the make window with methods that grab the focus.
30  * @version November 1997
31  * @author John D. Ramsdell
32  */

33 final class MakeInput
34 extends TextField
35 implements FocusListener
36 {
37   MakeInput(String JavaDoc text) {
38     super(text);
39   }
40
41   /**
42    * Make this object a focus listener for components that should not
43    * grab the focus. If another component gets the focus, this method
44    * grabs it back.
45    */

46   public void focusGained(FocusEvent e) {
47     requestFocus();
48   }
49
50   /**
51    * This method does nothing.
52    */

53   public void focusLost(FocusEvent e) {}
54
55 }
56
Popular Tags