G
Guest
I have an 'ImageButton' class.
When I change the text of ImageButton to a bigger text
e.g. "OK" -> "All Right!"
I want 'ImageButton' increases its width to keep the new text.
How can I do this?
My class implements these methods:
---------------
public class ImageButton extends Canvas implements MouseListener {
public void paint(Graphics g) { ... }
public Dimension getPreferredSize() { ... }
public Dimension getMinimumSize() { ... }
....
}
When I change the text of ImageButton to a bigger text
e.g. "OK" -> "All Right!"
I want 'ImageButton' increases its width to keep the new text.
How can I do this?
My class implements these methods:
---------------
public class ImageButton extends Canvas implements MouseListener {
public void paint(Graphics g) { ... }
public Dimension getPreferredSize() { ... }
public Dimension getMinimumSize() { ... }
....
}