/[classpath]/classpath/javax/swing/JComponent.java
ViewVC logotype

Diff of /classpath/javax/swing/JComponent.java

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

revision 1.38 by mark, Sun May 15 09:49:20 2005 UTC revision 1.39 by rabbit78, Wed May 18 08:18:09 2005 UTC
# Line 400  public abstract class JComponent extends Line 400  public abstract class JComponent extends
400      setDropTarget(new DropTarget());      setDropTarget(new DropTarget());
401      defaultLocale = Locale.getDefault();      defaultLocale = Locale.getDefault();
402      debugGraphicsOptions = DebugGraphics.NONE_OPTION;      debugGraphicsOptions = DebugGraphics.NONE_OPTION;
403        setRequestFocusEnabled(true);
404    }    }
405    
406    /**    /**
# Line 2324  public abstract class JComponent extends Line 2325  public abstract class JComponent extends
2325    }    }
2326    
2327    /**    /**
2328       * Requests that this component gets the input focus if the top level
2329       * window that contains this component has the focus and the
2330       * requestFocusEnabled property is set to <code>true</code>.
2331       *
2332       * The preconditions that have to be met to become a focus owner is that
2333       * the component must be displayable, visible and focusable.
2334       *
2335       * Note that this signals only a request for becoming focused. There are
2336       * situations in which it is not possible to get the focus. So developers
2337       * should not assume that the component has the focus until it receives
2338       * a {@link java.awt.event.FocusEvent} with a value of
2339       * {@link java.awt.event.FocusEvent.FOCUS_GAINED}.
2340       *
2341       * @return <code>false</code> if the focus change request will definitly
2342       *     fail, <code>true</code> if it will likely succeed
2343       *
2344       * @see {@link Component#requestFocusInWindow()}
2345       */
2346      public boolean requestFocusInWindow()
2347      {
2348        if (isRequestFocusEnabled())
2349          return super.requestFocusInWindow();
2350        else
2351          return false;
2352      }
2353    
2354      /**
2355     * This method is overridden to make it public so that it can be used     * This method is overridden to make it public so that it can be used
2356     * by look and feel implementations.     * by look and feel implementations.
2357     *     *

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

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