Skip to content

Commit

Permalink
javadoc update in JScrollbar and JComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
prsadhuk committed Jan 29, 2024
1 parent 2a42f5c commit 10b670c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
12 changes: 8 additions & 4 deletions src/java.desktop/share/classes/javax/swing/JComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1741,8 +1741,10 @@ public Dimension getPreferredSize() {
* Sets the maximum size of this component to a constant
* value. Subsequent calls to <code>getMaximumSize</code> will always
* return this value; the component's UI will not be asked
* to compute it. Setting the maximum size to <code>null</code>
* restores the default behavior.
* to compute it.
* Subclasses may choose to override this by returning its own maximum size
* in its {@code getMaximumSize} method.
* Setting the maximum size to <code>null</code> restores the default behavior.
*
* @param maximumSize a <code>Dimension</code> containing the
* desired maximum allowable size
Expand Down Expand Up @@ -1782,8 +1784,10 @@ public Dimension getMaximumSize() {
* Sets the minimum size of this component to a constant
* value. Subsequent calls to <code>getMinimumSize</code> will always
* return this value; the component's UI will not be asked
* to compute it. Setting the minimum size to <code>null</code>
* restores the default behavior.
* to compute it.
* Subclasses may choose to override this by returning its own minimum size
* in its {@code getMinimumSize} method.
* Setting the minimum size to <code>null</code> restores the default behavior.
*
* @param minimumSize the new minimum size of this component
* @see #getMinimumSize
Expand Down
14 changes: 8 additions & 6 deletions src/java.desktop/share/classes/javax/swing/JScrollBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -754,11 +754,11 @@ public void stateChanged(ChangeEvent e) {
}

/**
* Unlike most components, JScrollBar will derive the minimum size from
* Unlike most components, {@code JScrollBar} derives the minimum size from
* the preferred size in one axis and a fixed minimum size in the other.
* Thus, it overrides {@code JComponent.setMinimumSize} contract
* that subsequent calls to getMinimumSize will return the
* same value as set in {@code JComponent.setMinimumSize}
* that subsequent calls to {@code getMinimumSize} will return the
* same value as set in {@code JComponent.setMinimumSize}.
*
* @param minimumSize the new minimum size of this component
*/
Expand All @@ -767,11 +767,11 @@ public void setMinimumSize(Dimension minimumSize) {
}

/**
* Unlike most components, JScrollBar will derive the maximum size from
* Unlike most components, {@code JScrollBar} derives the maximum size from
* the preferred size in one axis and a fixed maximum size in the other.
* Thus, it overrides {@code JComponent.setMaximumSize} contract
* that subsequent calls to getMaximumSize will return the
* same value as set in {@code JComponent.setMaximumSize}
* that subsequent calls to {@code getMaximumSize} will return the
* same value as set in {@code JComponent.setMaximumSize}.
*
* @param maximumSize the desired maximum allowable size
*/
Expand All @@ -780,6 +780,7 @@ public void setMaximumSize(Dimension maximumSize) {
}

/**
* Returns the minimum size for the {@code JScrollBar}.
* The scrollbar is flexible along its scrolling axis and
* rigid along the other axis.
* As specified in {@code setMinimumSize} JScrollBar will derive the
Expand All @@ -798,6 +799,7 @@ public Dimension getMinimumSize() {
}

/**
* Returns the maximum size for the {@code JScrollBar}.
* The scrollbar is flexible along its scrolling axis and
* rigid along the other axis.
* As specified in {@code setMaximumSize} JScrollBar will derive the
Expand Down

0 comments on commit 10b670c

Please sign in to comment.