borland Packages  Class Hierarchy  dbswing Package 

BorderIcon component

java.lang.Object
   +----com.borland.dbswing.BorderIcon

About the BorderIcon component

Constructors  Properties  Methods  

Implements Serializable, Icon

Note: This is a feature of JBuilder Professional and Enterprise.

BorderIcon is a utility class for creating an Icon with a Border. It offers a convenient way of dynamically creating rollover icons out of ImageIcons without having to create multiple image files.

For example, to create a typical rollover icon (an icon with raised edges) out of an ImageIcon, do this:

ImageIcon imageIcon = new ImageIcon("image.gif");
JButton jButton = new JButton(imageIcon);
jButton.setRolloverIcon(new BorderIcon(imageIcon));
jButton.setBorder(null); // allows image with border to fill entire button 
BorderIcon uses a raised bevel border by default if a border is not explicitly specified.

BorderIcon constructors

BorderIcon properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

BorderIcon methods

Methods implemented in this class

Methods implemented in java.lang.Object


BorderIcon constructors

BorderIcon()

  public BorderIcon()
Creates a BorderIcon with no specified border or icon. Calls the constructor of this class which takes a Border and an Icon as parameters. Instantiates a new border using BorderFactory's createRaisedBevelBorder() method, and passes this new border, along with null for the Icon, to the other constructor.

BorderIcon(javax.swing.border.Border)

  public BorderIcon(Border border)
Creates a BorderIcon with the specified border. Calls the constructor of this class which takes a Border and an Icon as parameters. Passes the specified Border and null for the Icon to the other constructor.

Parameters:

border
The Border that becomes the border for the icon.

BorderIcon(javax.swing.border.Border, javax.swing.Icon)

  public BorderIcon(Border border, Icon icon)
Creates a BorderIcon with a specified border and icon.

Parameters:

border
The Border that becomes the border for the icon.
icon
The Icon that becomes the icon for the BorderIcon.

BorderIcon(javax.swing.Icon)

  public BorderIcon(Icon icon)
Creates a BorderIcon with a specified icon. Calls the constructor of this class which takes a Border and an Icon as parameters. Instantiates a new border using BorderFactory's createRaisedBevelBorder() method, and passes this new border, along with the specified icon, to the other constructor.

Parameters:

icon
The Icon that becomes the icon for the BorderIcon.

BorderIcon properties

border

 public Border getBorder()
 public void setBorder(Border border)
Returns and sets the border for this icon. The default border is a raised-bevel border.

icon

 public Icon getIcon()
 public void setIcon(Icon icon)
Returns and sets the icon used by this icon.

iconHeight

 public int getIconHeight()
This is an implementation of the Icon interface. It returns the height of this icon.

iconWidth

 public int getIconWidth()
This is an implementation of the Icon interface. It returns the width of this icon.