Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Combobox is not working after setting transparency to background color of frame- rgba

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Combobox is not working after setting transparency to background color of frame- rgba

    Hi to all,

    I created a frame and added a panel to the frame.

    In that panel, Iíve added a background image and components like combobox, button, etc. In that background image, some extra white space is there. My requirement is to make the frame transparent, so that the extra white space will not be visible.

    Iíve made that frame transparent by setting setBackground(new Color(255,255,255,0)) where the color parameters are red, green, blue, alpha.

    Since the value of alpha is zero, the frame is transparent. But, if I click the combobox it is not dropping down the items and I canít be able to select the items.

    If there is no alpha parameter (i.e., setBackground(new Color(255,255,255))), then the combobox is dropping down fine and can be able to select the items. But the frame is not transparent.

    If I make the frame transparent, other than the combobox all the components are working fine.


  2. #2
    Junior Member
    Join Date
    Jul 2012
    Posts
    5
    My Mood
    Cheerful
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Combobox is not working after setting transparency to background color of frame-

    Why u want to make the combobox transparent by the way?

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,266
    Thanks
    176
    Thanked 821 Times in 764 Posts
    Blog Entries
    5

    Default Re: Combobox is not working after setting transparency to background color of frame-


  4. #4
    Junior Member
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Combobox is not working after setting transparency to background color of frame-

    Quote Originally Posted by kvv230892 View Post
    Why u want to make the combobox transparent by the way?
    I want to make the frame transparent but not the combobox!

    jCbx.setBackground(new Color(238,238,238)); //To set the background color of the combobox
    setBackground(new Color(255,255,255,0)); //To set the background color of the frame


    My aim is that to make the background color of the frame as transparent and the background color of the combobox as opaque.

    I tried like this also,


    jCbx.setBackground(new Color(238,238,238,255)); //To set the background color of the combobox
    setBackground(new Color(255,255,255,0)); //To set the background color of the frame



    But,it didn't work

Similar Threads

  1. Setting a transparency level of a picture issue
    By Asido in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 18th, 2012, 05:42 AM
  2. adding background image to a frame???
    By overdriveboy in forum AWT / Java Swing
    Replies: 1
    Last Post: May 14th, 2012, 06:53 PM
  3. mode.addRow with background color
    By nsyncpilu in forum AWT / Java Swing
    Replies: 3
    Last Post: December 15th, 2011, 08:50 AM
  4. set Background Excel cell color using POI API
    By ngamal in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 26th, 2011, 11:20 AM
  5. Changing Panel Color with a ComboBox
    By bengregg in forum AWT / Java Swing
    Replies: 7
    Last Post: March 2nd, 2011, 09:04 PM