Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to tile image on jlabel?

 
dragon ji
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Tommy Greenberg
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx,Tommy Greenberg
I will try it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic