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 7642335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:09:49+00:00 2026-05-31T09:09:49+00:00

I have a program with some gui, on the JFrame I set, setBackground( new

  • 0

I have a program with some gui, on the JFrame I set,

 setBackground( new Color(107, 106, 104) );

The issue is that I get a greyish color, but not the right one. If I check it in PhotoShop, it gives me the RGB values (126, 125, 123)

Ps. I have tried with HEX value, the same result.

  • 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-31T09:09:51+00:00Added an answer on May 31, 2026 at 9:09 am
    I have a program with some gui, on the JFrame I set,
    
     setBackground( new Color(107, 106, 104) );
    
    [The problem] It gives a greyish color, but not the right one! 
    If I check the gui's color in Photo Shop, it gives me the RGB 
    values (126, 125, 123)
    

    you can not set setBackground for JFrame, this is only possible for ContentPane, for example

    JFrame#getContentPane.setBackground(new Color(107, 106, 104));
    

    EDIT

    enter image description here

    from code

    import java.awt.Color;
    import java.awt.Dimension;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    
    public class Check extends JFrame {
    
        private static final long serialVersionUID = 1L;
    
        public void makeUI() {
            JFrame f = new JFrame();
            f.getContentPane().setBackground(new Color(107, 106, 104));
            f.setDefaultCloseOperation(EXIT_ON_CLOSE);
            f.setSize(new Dimension(300, 200));
            f.setVisible(true);
        }
    
        public static void main(String[] args) {
    
            SwingUtilities.invokeLater(new Runnable() {
    
                @Override
                public void run() {
                    new Check().makeUI();
                }
            });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have program in Java that I want to rewrite (GUI and some new
I have created a GUI program that uses a class to perform some tasks.
I have a program that draws some vector graphics using System.Drawing and the Graphics
I have a program, and in that program there is some variables (username and
I have a C program that stores some object in java store using JNI.
I have a GUI problem that I would like to get sorted out, but
i have a program that takes some time creating pdf files i would like
I have a python program with a wxpython GUI and some command line parameters.
I have a python program that implements pygtk for GUI. I have it running
I have a GUI program that runs on a Windows CE 2.0 Device .

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.