Results 1 to 4 of 4
  1. #1
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default Adding transparent JSlider

    Hi!
    I added a JSlider to a jpanel that already got an image as background.
    Now the JSlider fills in it's area in the screen with ugly beige color. I want it to be transparent so that only the slider is visible with it's sticks and parts.

    Using button I could assign setContentAreaFilled(false);
    Now I cant, so any idea how to fix that?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Addez View Post
    Hi!
    I added a JSlider to a jpanel that already got an image as background.
    Now the JSlider fills in it's area in the screen with ugly beige color. I want it to be transparent so that only the slider is visible with it's sticks and parts.

    Using button I could assign setContentAreaFilled(false);
    Now I cant, so any idea how to fix that?
    A JSlider inherits the setOpague(boolean b) method; you can also specify if the ticks should be painted or other parts of the slider.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    Ahhh!!
    I used it and set opaque to true, totaly useless :P

    Thanks :D

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

Similar Threads

  1. transparent
    By chathura992 in forum NetBeans
    Replies: 2
    Last Post: 12-30-2010, 04:03 PM
  2. How to improve Jslider
    By JohnST in forum New To Java
    Replies: 3
    Last Post: 01-12-2010, 01:04 AM
  3. How can we zoom a map using JSlider
    By barney in forum AWT / Swing
    Replies: 5
    Last Post: 02-23-2009, 01:48 PM
  4. Got Trouble with JSlider
    By hungleon88 in forum Advanced Java
    Replies: 6
    Last Post: 08-30-2008, 05:02 PM
  5. jmf & JSlider
    By nathanr_kamal in forum AWT / Swing
    Replies: 6
    Last Post: 06-28-2008, 07:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •