Constructor and Description |
---|
ScaledIcon(Icon icon)
Create a scalable version of the given Icon.
|
ScaledIcon(Icon icon,
int width,
int height)
Create an icon that properly scales to the desired size.
|
ScaledIcon(Icon icon,
int width,
int height,
boolean preserveAspect)
Create an icon that properly scales to the desired size, and
whether to preserve the aspect ratio.
|
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight() |
int |
getIconWidth() |
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
Paint the icon scaled appropriately.
|
void |
setPreserveAspect(boolean p) |
void |
setSize(Dimension size) |
void |
setSize(int w,
int h) |
public ScaledIcon(Icon icon)
public ScaledIcon(Icon icon, int width, int height)
public ScaledIcon(Icon icon, int width, int height, boolean preserveAspect)
public void setPreserveAspect(boolean p)
public void setSize(Dimension size)
public void setSize(int w, int h)
public void paintIcon(Component c, Graphics g, int x, int y)
public int getIconWidth()
getIconWidth
in interface Icon
public int getIconHeight()
getIconHeight
in interface Icon
Copyright © 2023. All rights reserved.