This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes how to tile image on jlabel? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to tile image on jlabel?" Watch "how to tile image on jlabel?" New topic
Author

how to tile image on jlabel?

dragon ji
Ranch Hand

Joined: Oct 31, 2002
Posts: 110
Hi, guys,

I want to make a label using 3 images,two for top and tail,one for middle.and I want to tile the middle image.

How can I get it?

thanx a lot

Best Regards

Dragon


scjp 1.4<br />challenge haven't limit!
Tommy Greenberg
Greenhorn

Joined: Jul 30, 2004
Posts: 15
Make a class that extends a JLabel and overwrite the paint method. I would use photoshop or some other graphic editor to make the image you require and would just use that. Or make a JPanel and use the GridBagLayout to place each of them as separate labels in the arrangement you want.
dragon ji
Ranch Hand

Joined: Oct 31, 2002
Posts: 110
thanx,Tommy Greenberg
I will try it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to tile image on jlabel?
 
Similar Threads
tiles struts
Image effects...
BufferedImage and scanning pixels
Using Tiles and html:img tag
Tile Game