|
Java™ by example!
|
|
|
How do I draw an image in a JLabel?
Very simple: look at the constructors of JLabel and you'll see that some of them accept images. A JLabel can contain either text, an image or both. If you have both images and text, you can set the horizontal and vertical text position using the methods:
Here's a complete example:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|