File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding Label on another Label

 
satya sahu
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is it possible to aa label over another label ?

Regards,
Satya
 
Balasubramanian Chandrasekaran
Ranch Hand
Posts: 215
Firefox Browser Linux VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by satya sahu:
Hi,
Is it possible to aa label over another label ?

Regards,
Satya


Here what you mean adding Label over another label.Did you mean to change label Text or else Hide your 'aa' label and make some other label visible there.
 
satya sahu
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually i am setting the image on the first label and then i want to put another lable with a small image, on the top of the first lable. I will set the Opaque property so that background image will be the first label image and on top of that the second image i.e in the 2nd label.
Although i have different solutions to this problem, but i have to find out whether i can do it using label or not.

Please let me know if i am not explained the problem properly.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know. It sounds likely however. JLabel has an add() method, so I would suggest you try it and tell us all what happens.
 
Brian Cole
Author
Ranch Hand
Posts: 886
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Campbell Ritchie:
Don't know. It sounds likely however. JLabel has an add() method, so I would suggest you try it and tell us all what happens.


I guess there's no harm in trying it, but JLabel's add() methods shouldn't be used. They are only there because Swing components happen to extend from java.awt.Container.

Originally posted by satya sahu:
Actually i am setting the image on the first label and then i want to put another lable with a small image, on the top of the first lable.


It is possible to position one JLabel on top of another, but it seems to me there are much better/easier ways to achieve the effect you're looking for.

Here's the approach I would take:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic