Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/javax/swing/JComponent.java
          +++ new/src/share/classes/javax/swing/JComponent.java
↓ open down ↓ 72 lines elided ↑ open up ↑
  73   73   * To use a component that inherits from <code>JComponent</code>,
  74   74   * you must place the component in a containment hierarchy
  75   75   * whose root is a top-level Swing container.
  76   76   * Top-level Swing containers --
  77   77   * such as <code>JFrame</code>, <code>JDialog</code>,
  78   78   * and <code>JApplet</code> --
  79   79   * are specialized components
  80   80   * that provide a place for other Swing components to paint themselves.
  81   81   * For an explanation of containment hierarchies, see
  82   82   * <a
  83      - href="http://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html">Swing Components and the Containment Hierarchy</a>,
       83 + href="https://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html">Swing Components and the Containment Hierarchy</a>,
  84   84   * a section in <em>The Java Tutorial</em>.
  85   85   *
  86   86   * <p>
  87   87   * The <code>JComponent</code> class provides:
  88   88   * <ul>
  89   89   * <li>The base class for both standard and custom components
  90   90   *     that use the Swing architecture.
  91   91   * <li>A "pluggable look and feel" (L&amp;F) that can be specified by the
  92   92   *     programmer or (optionally) selected by the user at runtime.
  93   93   *     The look and feel for each component is provided by a
  94   94   *     <em>UI delegate</em> -- an object that descends from
  95   95   *     {@link javax.swing.plaf.ComponentUI}.
  96   96   *     See <a
  97      - * href="http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html">How
       97 + * href="https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html">How
  98   98   *     to Set the Look and Feel</a>
  99   99   *     in <em>The Java Tutorial</em>
 100  100   *     for more information.
 101  101   * <li>Comprehensive keystroke handling.
 102  102   *     See the document <a
 103      - * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html">How to Use Key Bindings</a>,
      103 + * href="https://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html">How to Use Key Bindings</a>,
 104  104   *     an article in <em>The Java Tutorial</em>,
 105  105   *     for more information.
 106  106   * <li>Support for tool tips --
 107  107   *     short descriptions that pop up when the cursor lingers
 108  108   *     over a component.
 109  109   *     See <a
 110      - * href="http://docs.oracle.com/javase/tutorial/uiswing/components/tooltip.html">How
      110 + * href="https://docs.oracle.com/javase/tutorial/uiswing/components/tooltip.html">How
 111  111   *     to Use Tool Tips</a>
 112  112   *     in <em>The Java Tutorial</em>
 113  113   *     for more information.
 114  114   * <li>Support for accessibility.
 115  115   *     <code>JComponent</code> contains all of the methods in the
 116  116   *     <code>Accessible</code> interface,
 117  117   *     but it doesn't actually implement the interface.  That is the
 118  118   *     responsibility of the individual classes
 119  119   *     that extend <code>JComponent</code>.
 120  120   * <li>Support for component-specific properties.
 121  121   *     With the {@link #putClientProperty}
 122  122   *     and {@link #getClientProperty} methods,
 123  123   *     you can associate name-object pairs
 124  124   *     with any object that descends from <code>JComponent</code>.
 125  125   * <li>An infrastructure for painting
 126  126   *     that includes double buffering and support for borders.
 127  127   *     For more information see <a
 128  128   * href="http://www.oracle.com/technetwork/java/painting-140037.html#swing">Painting</a> and
 129      - * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.htmll">How
      129 + * <a href="https://docs.oracle.com/javase/tutorial/uiswing/components/border.htmll">How
 130  130   *     to Use Borders</a>,
 131  131   *     both of which are sections in <em>The Java Tutorial</em>.
 132  132   * </ul>
 133  133   * For more information on these subjects, see the
 134  134   * <a href="package-summary.html#package_description">Swing package description</a>
 135  135   * and <em>The Java Tutorial</em> section
 136      - * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/jcomponent.html">The JComponent Class</a>.
      136 + * <a href="https://docs.oracle.com/javase/tutorial/uiswing/components/jcomponent.html">The JComponent Class</a>.
 137  137   * <p>
 138  138   * <code>JComponent</code> and its subclasses document default values
 139  139   * for certain properties.  For example, <code>JTable</code> documents the
 140  140   * default row height as 16.  Each <code>JComponent</code> subclass
 141  141   * that has a <code>ComponentUI</code> will create the
 142  142   * <code>ComponentUI</code> as part of its constructor.  In order
 143  143   * to provide a particular look and feel each
 144  144   * <code>ComponentUI</code> may set properties back on the
 145  145   * <code>JComponent</code> that created it.  For example, a custom
 146  146   * look and feel may require <code>JTable</code>s to have a row
 147  147   * height of 24. The documented defaults are the value of a property
 148  148   * BEFORE the <code>ComponentUI</code> has been installed.  If you
 149  149   * need a specific value for a particular property you should
 150  150   * explicitly set it.
 151  151   * <p>
 152  152   * In release 1.4, the focus subsystem was rearchitected.
 153  153   * For more information, see
 154      - * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
      154 + * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
 155  155   * How to Use the Focus Subsystem</a>,
 156  156   * a section in <em>The Java Tutorial</em>.
 157  157   * <p>
 158  158   * <strong>Warning:</strong> Swing is not thread safe. For more
 159  159   * information see <a
 160  160   * href="package-summary.html#threading">Swing's Threading
 161  161   * Policy</a>.
 162  162   * <p>
 163  163   * <strong>Warning:</strong>
 164  164   * Serialized objects of this class will not be compatible with
↓ open down ↓ 1121 lines elided ↑ open up ↑
1286 1286       * @see #print
1287 1287       * @since 1.6
1288 1288       */
1289 1289      public final boolean isPaintingForPrint() {
1290 1290          return getFlag(IS_PRINTING);
1291 1291      }
1292 1292  
1293 1293      /**
1294 1294       * In release 1.4, the focus subsystem was rearchitected.
1295 1295       * For more information, see
1296      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     1296 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
1297 1297       * How to Use the Focus Subsystem</a>,
1298 1298       * a section in <em>The Java Tutorial</em>.
1299 1299       * <p>
1300 1300       * Changes this <code>JComponent</code>'s focus traversal keys to
1301 1301       * CTRL+TAB and CTRL+SHIFT+TAB. Also prevents
1302 1302       * <code>SortingFocusTraversalPolicy</code> from considering descendants
1303 1303       * of this JComponent when computing a focus traversal cycle.
1304 1304       *
1305 1305       * @see java.awt.Component#setFocusTraversalKeys
1306 1306       * @see SortingFocusTraversalPolicy
↓ open down ↓ 41 lines elided ↑ open up ↑
1348 1348          FocusTraversalPolicy policy = nearestRoot.getFocusTraversalPolicy();
1349 1349          if (policy instanceof LegacyGlueFocusTraversalPolicy) {
1350 1350              ((LegacyGlueFocusTraversalPolicy)policy).
1351 1351                  unsetNextFocusableComponent(this, nextFocusableComponent);
1352 1352          }
1353 1353      }
1354 1354  
1355 1355      /**
1356 1356       * In release 1.4, the focus subsystem was rearchitected.
1357 1357       * For more information, see
1358      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     1358 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
1359 1359       * How to Use the Focus Subsystem</a>,
1360 1360       * a section in <em>The Java Tutorial</em>.
1361 1361       * <p>
1362 1362       * Overrides the default <code>FocusTraversalPolicy</code> for this
1363 1363       * <code>JComponent</code>'s focus traversal cycle by unconditionally
1364 1364       * setting the specified <code>Component</code> as the next
1365 1365       * <code>Component</code> in the cycle, and this <code>JComponent</code>
1366 1366       * as the specified <code>Component</code>'s previous
1367 1367       * <code>Component</code> in the cycle.
1368 1368       *
↓ open down ↓ 12 lines elided ↑ open up ↑
1381 1381          }
1382 1382          putClientProperty(NEXT_FOCUS, aComponent);
1383 1383          if (displayable) {
1384 1384              registerNextFocusableComponent(aComponent);
1385 1385          }
1386 1386      }
1387 1387  
1388 1388      /**
1389 1389       * In release 1.4, the focus subsystem was rearchitected.
1390 1390       * For more information, see
1391      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     1391 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
1392 1392       * How to Use the Focus Subsystem</a>,
1393 1393       * a section in <em>The Java Tutorial</em>.
1394 1394       * <p>
1395 1395       * Returns the <code>Component</code> set by a prior call to
1396 1396       * <code>setNextFocusableComponent(Component)</code> on this
1397 1397       * <code>JComponent</code>.
1398 1398       *
1399 1399       * @return the <code>Component</code> that will follow this
1400 1400       *        <code>JComponent</code> in the focus traversal cycle, or
1401 1401       *        <code>null</code> if none has been explicitly specified
↓ open down ↓ 12 lines elided ↑ open up ↑
1414 1414       * are requesting focus to honor this property. This is typically honored
1415 1415       * for mouse operations, but not keyboard operations. For example, look
1416 1416       * and feels could verify this property is true before requesting focus
1417 1417       * during a mouse operation. This would often times be used if you did
1418 1418       * not want a mouse press on a <code>JComponent</code> to steal focus,
1419 1419       * but did want the <code>JComponent</code> to be traversable via the
1420 1420       * keyboard. If you do not want this <code>JComponent</code> focusable at
1421 1421       * all, use the <code>setFocusable</code> method instead.
1422 1422       * <p>
1423 1423       * Please see
1424      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     1424 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
1425 1425       * How to Use the Focus Subsystem</a>,
1426 1426       * a section in <em>The Java Tutorial</em>,
1427 1427       * for more information.
1428 1428       *
1429 1429       * @param requestFocusEnabled indicates whether you want this
1430 1430       *        <code>JComponent</code> to be focusable or not
1431 1431       * @see <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
1432 1432       * @see java.awt.Component#setFocusable
1433 1433       */
1434 1434      public void setRequestFocusEnabled(boolean requestFocusEnabled) {
1435 1435          setFlag(REQUEST_FOCUS_DISABLED, !requestFocusEnabled);
1436 1436      }
1437 1437  
1438 1438      /**
1439 1439       * Returns <code>true</code> if this <code>JComponent</code> should
1440 1440       * get focus; otherwise returns <code>false</code>.
1441 1441       * <p>
1442 1442       * Please see
1443      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     1443 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
1444 1444       * How to Use the Focus Subsystem</a>,
1445 1445       * a section in <em>The Java Tutorial</em>,
1446 1446       * for more information.
1447 1447       *
1448 1448       * @return <code>true</code> if this component should get focus,
1449 1449       *     otherwise returns <code>false</code>
1450 1450       * @see #setRequestFocusEnabled
1451 1451       * @see <a href="../../java/awt/doc-files/FocusSpec.html">Focus
1452 1452       *      Specification</a>
1453 1453       * @see java.awt.Component#isFocusable
↓ open down ↓ 5 lines elided ↑ open up ↑
1459 1459      /**
1460 1460       * Requests that this <code>Component</code> gets the input focus.
1461 1461       * Refer to {@link java.awt.Component#requestFocus()
1462 1462       * Component.requestFocus()} for a complete description of
1463 1463       * this method.
1464 1464       * <p>
1465 1465       * Note that the use of this method is discouraged because
1466 1466       * its behavior is platform dependent. Instead we recommend the
1467 1467       * use of {@link #requestFocusInWindow() requestFocusInWindow()}.
1468 1468       * If you would like more information on focus, see
1469      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     1469 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
1470 1470       * How to Use the Focus Subsystem</a>,
1471 1471       * a section in <em>The Java Tutorial</em>.
1472 1472       *
1473 1473       * @see java.awt.Component#requestFocusInWindow()
1474 1474       * @see java.awt.Component#requestFocusInWindow(boolean)
1475 1475       * @since 1.4
1476 1476       */
1477 1477      public void requestFocus() {
1478 1478          super.requestFocus();
1479 1479      }
↓ open down ↓ 2 lines elided ↑ open up ↑
1482 1482       * Requests that this <code>Component</code> gets the input focus.
1483 1483       * Refer to {@link java.awt.Component#requestFocus(boolean)
1484 1484       * Component.requestFocus(boolean)} for a complete description of
1485 1485       * this method.
1486 1486       * <p>
1487 1487       * Note that the use of this method is discouraged because
1488 1488       * its behavior is platform dependent. Instead we recommend the
1489 1489       * use of {@link #requestFocusInWindow(boolean)
1490 1490       * requestFocusInWindow(boolean)}.
1491 1491       * If you would like more information on focus, see
1492      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     1492 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
1493 1493       * How to Use the Focus Subsystem</a>,
1494 1494       * a section in <em>The Java Tutorial</em>.
1495 1495       *
1496 1496       * @param temporary boolean indicating if the focus change is temporary
1497 1497       * @return <code>false</code> if the focus change request is guaranteed to
1498 1498       *         fail; <code>true</code> if it is likely to succeed
1499 1499       * @see java.awt.Component#requestFocusInWindow()
1500 1500       * @see java.awt.Component#requestFocusInWindow(boolean)
1501 1501       * @since 1.4
1502 1502       */
↓ open down ↓ 1 lines elided ↑ open up ↑
1504 1504          return super.requestFocus(temporary);
1505 1505      }
1506 1506  
1507 1507      /**
1508 1508       * Requests that this <code>Component</code> gets the input focus.
1509 1509       * Refer to {@link java.awt.Component#requestFocusInWindow()
1510 1510       * Component.requestFocusInWindow()} for a complete description of
1511 1511       * this method.
1512 1512       * <p>
1513 1513       * If you would like more information on focus, see
1514      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     1514 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
1515 1515       * How to Use the Focus Subsystem</a>,
1516 1516       * a section in <em>The Java Tutorial</em>.
1517 1517       *
1518 1518       * @return <code>false</code> if the focus change request is guaranteed to
1519 1519       *         fail; <code>true</code> if it is likely to succeed
1520 1520       * @see java.awt.Component#requestFocusInWindow()
1521 1521       * @see java.awt.Component#requestFocusInWindow(boolean)
1522 1522       * @since 1.4
1523 1523       */
1524 1524      public boolean requestFocusInWindow() {
1525 1525          return super.requestFocusInWindow();
1526 1526      }
1527 1527  
1528 1528      /**
1529 1529       * Requests that this <code>Component</code> gets the input focus.
1530 1530       * Refer to {@link java.awt.Component#requestFocusInWindow(boolean)
1531 1531       * Component.requestFocusInWindow(boolean)} for a complete description of
1532 1532       * this method.
1533 1533       * <p>
1534 1534       * If you would like more information on focus, see
1535      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     1535 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
1536 1536       * How to Use the Focus Subsystem</a>,
1537 1537       * a section in <em>The Java Tutorial</em>.
1538 1538       *
1539 1539       * @param temporary boolean indicating if the focus change is temporary
1540 1540       * @return <code>false</code> if the focus change request is guaranteed to
1541 1541       *         fail; <code>true</code> if it is likely to succeed
1542 1542       * @see java.awt.Component#requestFocusInWindow()
1543 1543       * @see java.awt.Component#requestFocusInWindow(boolean)
1544 1544       * @since 1.4
1545 1545       */
↓ open down ↓ 1044 lines elided ↑ open up ↑
2590 2590      public BaselineResizeBehavior getBaselineResizeBehavior() {
2591 2591          if (ui != null) {
2592 2592              return ui.getBaselineResizeBehavior(this);
2593 2593          }
2594 2594          return BaselineResizeBehavior.OTHER;
2595 2595      }
2596 2596  
2597 2597      /**
2598 2598       * In release 1.4, the focus subsystem was rearchitected.
2599 2599       * For more information, see
2600      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
     2600 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
2601 2601       * How to Use the Focus Subsystem</a>,
2602 2602       * a section in <em>The Java Tutorial</em>.
2603 2603       * <p>
2604 2604       * Requests focus on this <code>JComponent</code>'s
2605 2605       * <code>FocusTraversalPolicy</code>'s default <code>Component</code>.
2606 2606       * If this <code>JComponent</code> is a focus cycle root, then its
2607 2607       * <code>FocusTraversalPolicy</code> is used. Otherwise, the
2608 2608       * <code>FocusTraversalPolicy</code> of this <code>JComponent</code>'s
2609 2609       * focus-cycle-root ancestor is used.
2610 2610       *
↓ open down ↓ 370 lines elided ↑ open up ↑
2981 2981              else {
2982 2982                  return false;
2983 2983              }
2984 2984          }
2985 2985      }
2986 2986  
2987 2987      /**
2988 2988       * Registers the text to display in a tool tip.
2989 2989       * The text displays when the cursor lingers over the component.
2990 2990       * <p>
2991      -     * See <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/tooltip.html">How to Use Tool Tips</a>
     2991 +     * See <a href="https://docs.oracle.com/javase/tutorial/uiswing/components/tooltip.html">How to Use Tool Tips</a>
2992 2992       * in <em>The Java Tutorial</em>
2993 2993       * for further documentation.
2994 2994       *
2995 2995       * @param text  the string to display; if the text is <code>null</code>,
2996 2996       *              the tool tip is turned off for this component
2997 2997       * @see #TOOL_TIP_TEXT_KEY
2998 2998       * @beaninfo
2999 2999       *   preferred: true
3000 3000       * description: The text to display in a tool tip.
3001 3001       */
↓ open down ↓ 199 lines elided ↑ open up ↑
3201 3201       * If the new {@code TransferHandler} is {@code null}, this method removes
3202 3202       * the drop target.
3203 3203       * <p>
3204 3204       * Under two circumstances, this method does not modify the drop target:
3205 3205       * First, if the existing drop target on this component was explicitly
3206 3206       * set by the developer to a {@code non-null} value. Second, if the
3207 3207       * system property {@code suppressSwingDropSupport} is {@code true}. The
3208 3208       * default value for the system property is {@code false}.
3209 3209       * <p>
3210 3210       * Please see
3211      -     * <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
     3211 +     * <a href="https://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
3212 3212       * How to Use Drag and Drop and Data Transfer</a>,
3213 3213       * a section in <em>The Java Tutorial</em>, for more information.
3214 3214       *
3215 3215       * @param newHandler the new {@code TransferHandler}
3216 3216       *
3217 3217       * @see TransferHandler
3218 3218       * @see #getTransferHandler
3219 3219       * @since 1.4
3220 3220       * @beaninfo
3221 3221       *        bound: true
↓ open down ↓ 2363 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX