Back to index

wims  3.65+svn20090927
MyTextField.java
Go to the documentation of this file.
00001 package rene.gui;
00002 
00003 import java.awt.TextField;
00004 import java.awt.event.FocusEvent;
00005 import java.awt.event.FocusListener;
00006 
00011 public class MyTextField extends TextField
00012        implements FocusListener
00013 {      public MyTextField (String s, int n)
00014        {      super(s,n);
00015               if (Global.NormalFont!=null) setFont(Global.NormalFont);
00016               addFocusListener(this);
00017        }
00018        public MyTextField (String s)
00019        {      super(s);
00020               if (Global.NormalFont!=null) setFont(Global.NormalFont);
00021               addFocusListener(this);
00022        }
00023        public MyTextField ()
00024        {      if (Global.NormalFont!=null) setFont(Global.NormalFont);
00025               addFocusListener(this);
00026        }
00027        public void focusGained (FocusEvent e)
00028        {      setSelectionStart(0);
00029        }
00030        public void focusLost (FocusEvent e)
00031        {      setSelectionStart(0);
00032               setSelectionEnd(0);
00033        }
00034 }