2 Replies Latest reply: May 16, 2008 11:50 AM by 843851 RSS

    How to make transperent widget.

    843851
      Hi all,

      I am new to this xlet things and it has been long time since I worked on java. so, this might have a simple solution which I am overlooking.
      I have HStaticIcon in the background and trying to put HStaticText on the top. I want to make static text background transperent so, All I want see is text and background image.

      Is there any way I can do it?

      Thanks
        • 1. Re: How to make transperent widget.
          843851
          Text elements have a method that allows you to choose how you want to draw the background. You get what you need with the .setBackgroundMode() method. More exactly with something like
          HStaticText example = new HStaticText(the constructor you need);
          example.setBackgroundMode(HStaticText.NO_BACKGROUND_FILL);
          Try to get a good color combination or text size so you can still read the text after this change.
          • 2. Re: How to make transperent widget.
            843851
            Thanks for the reply. This is what I was doing and did not work but after your replay I looked at the code again and there were 2 constructors and I was only adding it to one constructor which was not being called . Adding to both fixed the problem.

            Thanks again.