Making a panel and its contents transparent

Discussion in 'Java' started by Kaish, Feb 27, 2007.

  1. Kaish

    Kaish Guest

    Hi guys,

    I'm coding an app that draws a little circle every time a user clicks
    the mouse. This is fine and working. However, I want to be able to
    toggle all the circles between visible and invisible.

    The best way I can think of is to create one big panel and put all my
    other panels containing their components inside it, then make a
    checkbox that sets that big panel's opacity to false. I do this, but
    the panel remains exactly the same.

    I thought it might have been a repaint() problem, so I tried making
    the panel not opaque at initialization, but all the components inside
    still remain visible.

    Am I missing something obvious?

    Thanks,
    Kaish
    Kaish, Feb 27, 2007
    #1
    1. Advertising

  2. On Feb 28, 5:23 am, "Kaish" <> wrote:
    ...
    > I'm coding an app that draws a little circle every time a user clicks
    > the mouse. This is fine and working. However, I want to be able to
    > toggle all the circles between visible and invisible.
    >
    > The best way I can think of is to create one big panel and put all my
    > other panels containing their components inside it, then make a
    > checkbox that sets that big panel's opacity to false. I do this, but
    > the panel remains exactly the same.
    >
    > I thought it might have been a repaint() problem, so I tried making
    > the panel not opaque at initialization, but all the components inside
    > still remain visible.
    >
    > Am I missing something obvious?


    The Opacity of the panel does not apply
    to things inside it, only things *behind*
    it.

    Andrew T.
    Andrew Thompson, Feb 28, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SmF4?=
    Replies:
    2
    Views:
    1,962
    Ismail Rajput
    Feb 21, 2004
  2. GD
    Replies:
    1
    Views:
    346
    darrel
    Jan 24, 2005
  3. thunk
    Replies:
    1
    Views:
    294
    thunk
    Mar 30, 2010
  4. thunk
    Replies:
    0
    Views:
    458
    thunk
    Apr 1, 2010
  5. thunk
    Replies:
    14
    Views:
    606
    thunk
    Apr 3, 2010
Loading...

Share This Page