Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7490453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:36:28+00:00 2026-05-29T15:36:28+00:00

How do you change the color scheme of a basic ComboBox UI? I what

  • 0

How do you change the color scheme of a basic ComboBox UI? I what I’ve tried is: setForeGround, setBackground, setOpaque(true), setOpaque(false) setBorder. But none of these work.

My code right now is:

    weaponCB.setBounds(27,250,150,30);
    weaponCB.setUI(new BasicComboBoxUI());
    weaponCB.setForeground(Color.white);
    weaponCB.setBackground(Color.black);
    weaponCB.setBorder(whiteBorder);
    weaponCB.setFont(new Font("Trajan Pro", Font.BOLD, 15));
    lP.add(weaponCB, new Integer(2));

This is what appears:

enter image description here

But what I really want is for the drop down section (white region) to look like the display, (black region with "LANCE" in white) i.e have the background be black, the border be white, and, the words be white. If this is possible and you tell me how, it would be a big help to me. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:36:29+00:00Added an answer on May 29, 2026 at 3:36 pm

    Very strange, but when I put weaponCB.setUI(new BasicComboBoxUI()); under the setBackground and setForeground and setBorder, the combobox works as expected. Only the border doesn’t show up.

        weaponCB.setBounds(27,250,150,30);
        weaponCB.setForeground(Color.white);
        weaponCB.setBackground(Color.black);
        weaponCB.setBorder(whiteBorder);
        weaponCB.setFont(new Font("Trajan Pro", Font.BOLD, 15));
        lP.add(weaponCB, new Integer(2));
        weaponCB.setUI(new BasicComboBoxUI());
    

    enter image description here

    Another thing that worked was:

    @Override
                public void paint(Graphics g) {
                    setBackground(Color.black);
                    setForeground(Color.white);
                    super.paint(g);
                }
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to change the ReSharper color scheme in VS2008 SP1? I've
How can I change netbeans color scheme to some predetermined theme? I don't want
I am trying to change the color scheme in Komodo Edit, version 6. I
I remember long ago there is option to change color-scheme for source on BitBucket.
When I change my color scheme in command-line Vim on Ubuntu 11.04, stripes on
How can I change color of a section header in UITableView? EDIT : The
I want to change color of the UINavigationBar? Is it possible to keep different
I want to change color of ListView separator line.
I want the tr that's currently hovered over to change color, and then change
I won't use GIcon to change for the marker.Any other ways to change color

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.