/[classpath]/classpath/java/awt/KeyboardFocusManager.java
ViewVC logotype

Diff of /classpath/java/awt/KeyboardFocusManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by tromey, Mon Oct 3 17:21:06 2005 UTC revision 1.17 by rabbit78, Fri Oct 28 16:41:16 2005 UTC
# Line 288  public abstract class KeyboardFocusManag Line 288  public abstract class KeyboardFocusManag
288      KeyboardFocusManager manager;      KeyboardFocusManager manager;
289    
290      if (m == null)      if (m == null)
291        manager = createFocusManager();        manager = new DefaultKeyboardFocusManager();
292      else      else
293        manager = m;        manager = m;
294    
# Line 296  public abstract class KeyboardFocusManag Line 296  public abstract class KeyboardFocusManag
296    }    }
297    
298    /**    /**
    * Creates a KeyboardFocusManager. The exact class is determined by the  
    * system property 'gnu.java.awt.FocusManager'. If this is not set,  
    * we default to DefaultKeyboardFocusManager.  
    */  
   private static KeyboardFocusManager createFocusManager()  
   {  
     String fmClassName = System.getProperty("gnu.java.awt.FocusManager",  
                                        "java.awt.DefaultKeyboardFocusManager");  
     try  
       {  
         Class fmClass = Class.forName(fmClassName);  
         KeyboardFocusManager fm = (KeyboardFocusManager) fmClass.newInstance();  
         return fm;  
       }  
     catch (ClassNotFoundException ex)  
       {  
         System.err.println("The class " + fmClassName + " cannot be found.");  
         System.err.println("Check the setting of the system property");  
         System.err.println("gnu.java.awt.FocusManager");  
         return null;  
       }  
     catch (InstantiationException ex)  
       {  
         System.err.println("The class " + fmClassName + " cannot be");  
         System.err.println("instantiated.");  
         System.err.println("Check the setting of the system property");  
         System.err.println("gnu.java.awt.FocusManager");  
         return null;  
       }  
     catch (IllegalAccessException ex)  
       {  
         System.err.println("The class " + fmClassName + " cannot be");  
         System.err.println("accessed.");  
         System.err.println("Check the setting of the system property");  
         System.err.println("gnu.java.awt.FocusManager");  
         return null;  
       }  
   }  
   
   /**  
299     * Retrieve the {@link Component} that has the keyboard focus, or     * Retrieve the {@link Component} that has the keyboard focus, or
300     * null if the focus owner was not set by a thread in the current     * null if the focus owner was not set by a thread in the current
301     * {@link java.lang.ThreadGroup}.     * {@link java.lang.ThreadGroup}.

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26