Java Reference
In-Depth Information
public void
setBackground(Color theColor)
Sets the background color of this component.
public void
setMaximumSize(Dimension maximumSize)
Sets the maximum size of the button or label. Note that this is only a suggestion to the layout
manager. The layout manager is not required to respect this maximum size. The following special
case will work for most simple situations. The
int
values give the width and height in pixels.
public void
setMaximumSize(
new
Dimension(
int
width,
int
height))
public void
setMinimumSize(Dimension minimumSize)
Sets the minimum size of the button or label. Note that this is only a suggestion to the layout
manager. The layout manager is not required to respect this minimum size.
Although we do not discuss the
Dimension
class, the following special case is intuitively clear
and will work for most simple situations. The
int
values give the width and height in pixels.
public void
setMinimumSize(
new
Dimension(
int
width,
int
height))
public void
setPreferredSize(Dimension preferredSize)
Sets the preferred size of the button or label. Note that this is only a suggestion to the layout
manager. The layout manager is not required to use the preferred size. The following special case
will work for most simple situations. The
int
values give the width and height in pixels.
public void
setPreferredSize(
new
Dimension(
int
width,
int
height))
public void
setText(String text)
Makes
text
the only text on this component.
ArrayList<T>
Package:
java.util
Ancestor classes:
Object
|
+--AbstractCollection<T>
|
+--AbstractList<T>
|
+--ArrayList<T>
All the exception classes mentioned are unchecked exceptions, which means they are not
required to be caught in a
catch
block or declared in a
throws
clause.
NoSuchElementException
is in the
java.util
package, which requires an import statement
if your code mentions the
NoSuchElementException
class. All the other exception classes
mentioned are in the package
java.lang
and so do not require any import statement.