How to change background color in a window? Please help.

Please help me to set background color to my window that includes some panels components.
I have tried
content.setBackground(Color.green); and
frame.setBackground(Color.RED);
but nothing works?
Please what should I change in my code? Thanks already in advance for helping!!
Main parts of my code:
public void addComponentToPane(Container allComponents) throws IOException
definePanels();
allComponents.setLayout(new BoxLayout(allComponents, BoxLayout.Y_AXIS));
allComponents.add(panel_introduction);
allComponents.add(panel_n);
allComponents.add(panel_resultTitle);
allComponents.add(panel_w);
allComponents.add(panel_testing);
allComponents.setVisible(true);
public static void main(String[] args) throws IOException
try {
GraphicsDevice device;
Container content;
JFrame frame = new JFrame("ImageOrder");
device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
device.setFullScreenWindow(frame);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
SwingApplication app = new SwingApplication();
content = frame.getContentPane();
content.setBackground(Color.green);
app.addComponentToPane(content);
frame.setVisible(true);
finally {
System.out.println("helle");
}

import java.awt.Color;
import javax.swing.*;
class Test extends JFrame {
     public Test( ){
          getContentPane().setBackground(Color.RED);
          pack();
          setSize(500, 500);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
     public static void main(String[] argv) {
          new Test().setVisible(true);
}

Similar Messages

  • How to change background color in AutoComplete window ?

    Is it possible to change background color in AutoComplete window ?

    Bob, A.Ankit, you're both chasing a ghost here.
    The screenshot shows an autocomplete enabled textbox with its dropdown list of autocomplete values to choose from. There is no property defining its backcolor. Not in the textbox nor in any class, neither any other baseclass nor _combobox of _base.vcx
    The only way to chnage that color is not recommended, via changing windows theme colors. That would effect any window and control.
    If you need another color even turning off themes won't help as VFP doesn't offer any property controlling that color, so you really would need to implement the autocomplete feature yourself, if you want the specify this backcolor.
    Bye, Olaf.
    Olaf Doschke - TMN Systemberatung GmbH http://www.tmn-systemberatung.de

  • How to change background color in small windows?

    MacBook Pro, OS 10.6.3, G5.
    When I open an image to edit, the adjustable small windows, e.g., Navigator, size, opacty, all have a dark gray background that makes reading the number almost impossible.  Surely I am doing something wrong but I'll be danged if I can figure out how to change that background.  In fact, in the individual preferences also, e.g., Units & Rulers, the "adjustable" small windows (Column Size: width, gutter; New Document Preset Resolutions: print resolution, screen resolution) are also very dark. 
    I have used Elements for Windows for years and have just received Elements 8 for Mac and this is extremely frustrating.  I appreciate your help and your patience as I try to sort this out and solved

    I greatly appreciate the two responses above. However I think I may be out of luck. The first response doesn't seem to include the Mac operating system, which I am using, and the second may not have understood my problem - but I could not figure out how to follow the advice given using "preferences" to even try it. It appears to be a matter of terrible user-oriented design by Adobe. I have in fact started again using my earlier version on my old XP Windows machine, as my brand new version is essentially useless to me - I simply can't read the dark grey numbers on the dark grey "windows".

  • How to change background color in photoshop cs3

    how to change background color in photoshop cs3
    Please help me...

    Background for what? You need to explain better and be more specific.
    Mylenium

  • How to change background color in online editor

    How to change background color in online editor

    Jeff,
    if you try to change all the plsql keywords to the same background color (that is not either white or black or blue) via the options panel in SQL Developer (Code Editor > PLSQL syntax colors), you will get the new background color in the worksheet only for the areas with plsql text, while the areas without any text will have the same background color as the base color scheme you started with. This means that there is no way to change the "general background" color via the options panel, but you have to use the same background color of one of the predefined color schemes.
    This seems to me a bug, but probably it's not considered high priority, so it will not be fixed for the time being.
    I would like to stress the fact that being able to change the color scheme of the development environment that you use every day about 8 hours a day can make quite a difference on your eyes at the end of the day.
    Thanks,
    Paolo

  • How to change background color of multilevel textbox in oracle form 6i

    hi
    How To Change background Color of the Text.
    In One Multilevel Block 10 Record is Display At a Time in a Text Box (Name is AMTt)
    This Text Box display , Buffer and Record Length is 10
    In Case Of Amount is Less 500 then Text Color Is Red(Or Any) and In Case Amount Is More 500 Then Color is Green (Or Any).
    Me Use This Code in PRE_RECORD EVENT
    TCMTL is Block name
    TCMTL_AMT is Text Box Name
    if :TCMTL.TCMTL_AMT >5000 then
         g_fun.msgbox('Values is more');
         Set_Item_Property('TCMTL_AMT' , BACKGROUND_COLOR, 'r50g100b100');
    else
         g_fun.msgbox('Values is Less');
         Set_Item_Property('TCMTL_AMT' , BACKGROUND_COLOR, 'r50g100b10');
    end if;     
    but This Code Is Refer Only 10th Value and change color depend on value.
    so
    possible to Different color in One Block Text Box Then how?

    DECLARE
         cur_itm VARCHAR2(80);
         cur_block VARCHAR2(80) := Name_in('system.trigger_block') ;
         BEGIN
         cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
              cur_itm := cur_block||'.'||cur_itm;
              --:global.VISUAL_ATTRIBUTE:= 'BACKGROUND_COLOR';
              --:global.VISUAL_ATTRIBUTE:= get_item_property(cur_block||'.'||cur_itm ,Background_Color);
              IF :TCMTL.TCMTL_AMT >= 500 THEN
                             Set_Item_Instance_Property( cur_itm, CURRENT_RECORD, VISUAL_ATTRIBUTE,'r50g100b100');
                   ELSE
                             Set_Item_Instance_Property( cur_itm, CURRENT_RECORD, VISUAL_ATTRIBUTE,'r5g100b10');
                   END IF;
                             cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
                   END LOOP;
                   next_record;
    END;
    this is my in that how to set a VISUAL_ATTRIBUTE, and where to set so get a background color of text and change

  • HT201303 I forget answer security questions. How to changer answer your security questions?.Please help me!

    I forget answer security questions.
    How to changer answer your security questions.
    Please help me!. Thankyou very much!

    Try going to https://appleid.apple.com/, click 'Manage your account' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and see if you can change your questions/answers, and then click Save at the bottom right.

  • How to change background color to JCheckBox in a JTable?

    Dear Friends,
    I have an JTable in my application. It has four columns. First, third and fourth column contains JCheckBox (JCheckBox is created using Boolean.class), secod column contains values.
    I have to change some of the cell color where JCheckBox is present.
    Could anyone please tell me how to change the color of the cell in the JTable?
    Thanks in advance,
    Sathish kumar D

    You would use a custom renderer.
    To get better help sooner, post a SSCCE that clearly demonstrates your problem.
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    db
    Alternative link: SSCCE
    Edited by: Darryl.Burke

  • How to change Background colors in photos

    Hi all,
    I could use some help with changing background color of attached example.  I want to be able to change background of this photo and have a few examples of it with blue, red and green background color.
    any help is appreciated.
    Thanks,
    Den

    With the selection still active apply a Solid Color adjustment layer in a new colour.
    Adjust the opacity and blending mode to suit.
    Do a Save as...    using a different file name and repeat with different colours.

  • I have adobe cc on pc but i have now joined the mac world but not sure how i change my pc software to mac please help

    i have adobe cc on pc but i have now joined the mac world but not sure how i change my pc software to mac please help

    Your Photoshop CC can be installed on a Mac or PC. Just install the Mac CC Desktop app and install Photoshop CC from there. It will be in your Application folder.

  • How can change background color of drop down menu navigation?

    Hi,
    I am using multi level drop-down-navigation menu in my website.
    I am get good drop-down menu from htmldrive.net, but problem is how can change menu background color black to other colors.
    please help me
    Link & code is given below
    http://www.htmldrive.net/items/demo/913/Multi-Level-Drop-Down-Menu-Navigation-with-CSS3
    HTML Code
    <div id="nav">
    <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">About Us</a></li>
    <li><a href="#">Our Portfolio</a></li>
    <li><a href="#">One Dropdown</a>
            <ul>
            <li><a href="#">Level 2.1</a></li>
            <li><a href="#">Level 2.2</a></li>
            <li><a href="#">Level 2.3</a></li>
            <li><a href="#">Level 2.4</a></li>
            <li><a href="#">Level 2.5</a></li>
            </ul>
    </li>
    <li><a href="#">Three Levels</a>
            <ul>
            <li><a href="#">Level 2.1</a></li>
            <li><a href="#">Level 2.2</a></li>
            <li><a href="#">Level 2.3</a>
                    <ul>
                    <li><a href="#">Level 2.3.1</a></li>
                    <li><a href="#">Level 2.3.2</a></li>
                    <li><a href="#">Level 2.3.3</a></li>
                    <li><a href="#">Level 2.3.4</a></li>
                    <li><a href="#">Level 2.3.5</a></li>
                    <li><a href="#">Level 2.3.6</a></li>
                    <li><a href="#">Level 2.3.7</a></li>
                    </ul>
            </li>
            <li><a href="#">Level 2.4</a></li>
            <li><a href="#">Level 2.5</a></li>
            </ul>
    </li>
    <li><a href="#">Services</a></li>
    <li><a href="#">Contact Us</a></li>
    </ul>
    </div>
    CSS CODE
    #nav {
            float: left;
            font: bold 12px Arial, Helvetica, Sans-serif;
            border: 1px solid #121314;
            border-top: 1px solid #2b2e30;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
            overflow: hidden;
    #nav ul {
            margin:0;
            padding:0;
            list-style:none;
    #nav ul li {
            float:left;
    #nav ul li a {
            float: left;
            color:#d4d4d4;
            padding: 10px 20px;
            text-decoration:none;
            background:#3C4042;
            background: -webkit-gradient( linear, left bottom, left top, color-stop(0.09, rgb(59,63,65)), color-stop(0.55, rgb(72,76,77)), color-stop(0.78, rgb(75,77,77)) );
            background: -moz-linear-gradient( center bottom, rgb(59,63,65) 9%, rgb(72,76,77) 55%, rgb(75,77,77) 78% );
            background: -o-linear-gradient( center bottom, rgb(59,63,65) 9%, rgb(72,76,77) 55%, rgb(75,77,77) 78% );
            box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 0 5px rgba(0, 0, 0, 0.1) inset;
            border-left: 1px solid rgba(255, 255, 255, 0.05);
            border-right: 1px solid rgba(0,0,0,0.2);
            text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.6);
    #nav li ul {
            background:#3C4042;
            background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.09, rgb(77,79,79)), color-stop(0.55, rgb(67,70,71)), color-stop(0.78, rgb(69,70,71)) );
            background-image: -moz-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% );
            background-image: -o-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% );
            border-radius: 0 0 10px 10px;
            -moz-border-radius: 0 0 10px 10px;
            -webkit-border-radius: 0 0 10px 10px;
            left: -999em;
            margin: 35px 0 0;
            position: absolute;
            width: 160px;
            z-index: 9999;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) inset;
            -moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) inset;
            -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) inset;
            border: 1px solid rgba(0, 0, 0, 0.5);
    #nav li ul a {
            background: none;
            border: 0 none;
            margin-right: 0;
            width: 120px;
            box-shadow: none;
            -moz-box-shadow: none;
            -webkit-box-shadow: none;
            border-bottom: 1px solid transparent;
            border-top: 1px solid transparent;

    Change this:
    .ddsmoothmenu{
    font: bold 12px Verdana;
    background: #414141; /*background of menu bar (default state)*/
    width: 100%;
    to this:
    .ddsmoothmenu{
    font: bold 12px Verdana;
    background: #new color code;
    width: 100%;
    And repeat this on other selectors.
    Nancy O.

  • How to change background color of text in pdf based by font name

    Hi
    How to change the background color of text in PDF based by font name. Is there any option in Javascript. e.g: If PDF containing ARIAL font, the ARIAL text background color needs to be changed in red color for all pages. Same for all fonts with different different color in the PDF.
    Thanks in Advance

    Hi
    1) Is there any possibilities to highlight with different color based on font using javascript
    2) list of font used in PDF using javascript
    3) How to hilight the text using javascript
    Thanks in Advance

  • How to change background color in mail messages?

    Capacity to change background colours seems to have been removed.  Has anyone found where to do this please???

    It's still available in Lion's version of Mail.
    Open a New Message window in Mail. Then select Show Fonts from the Format menu.
    In the Fonts screen, click the button for Document Color; a clor selection window will open. In that, choose the color you want for background.
    Note - if you do this before entering any text in the New Message, you can save it as a Stationery item, which means you can select it from the Stationery menu in the future, saving many steps.

  • How to change background color in code editor?

    Hi. Some of the pre-selectable Schemes under Tools->Preferences->Code Editor->PL/SQL Syntax Color (e. g. Ocean) have a "global" default background color that applies to all styles. How can I edit this color for my own color scheme?
    (SQL Developer version 3.1.07)

    Jeff,
    if you try to change all the plsql keywords to the same background color (that is not either white or black or blue) via the options panel in SQL Developer (Code Editor > PLSQL syntax colors), you will get the new background color in the worksheet only for the areas with plsql text, while the areas without any text will have the same background color as the base color scheme you started with. This means that there is no way to change the "general background" color via the options panel, but you have to use the same background color of one of the predefined color schemes.
    This seems to me a bug, but probably it's not considered high priority, so it will not be fixed for the time being.
    I would like to stress the fact that being able to change the color scheme of the development environment that you use every day about 8 hours a day can make quite a difference on your eyes at the end of the day.
    Thanks,
    Paolo

  • How to change background color of row of a table in a panel table

    hi! im trouble right now, somebody help me. i have a matrix of row and column, panel row and panel table in jsp. my problem is how can i change the background color of a row once it clicked. i have row in table which have panel table with panel column and panel row.
    i have already work for it but i only change the background color once i clicked is the first row and first column then the rest row and column is not working..pls.. give me sample code for it..thnx a lot!!!
    Thnank's,
    froilet

    Ok! I have 2 jsp, the input jsp and display.jsp! Once i input value on input.jsp, it will display on display.jsp. I have also my javascript named updateBin.js. Now, how can i update each row once i clicked it... the succeeding rows and columns..hope u help me with this..here is my code:
    Display.jsp
    <html:html locale="true">
    <head>
         <html:base/><meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Strip Map Loader</title><script type="text/javascript" src="js/updateBin.js"></script>
    </head>
         <%      
              int intRow = Integer.parseInt(request.getParameter("intRows"));
              int intColumn = Integer.parseInt(request.getParameter("intColumns"));
              int intPanelRow = Integer.parseInt(request.getParameter("intPanelRows"));
              int intPanelColumn = Integer.parseInt(request.getParameter("intPanelColumns"));
         %>
    <BODY bgcolor="#33b9ec" leftmargin="50%">
         <b>Strip ID:  </b><font color="red" face="arial"><b><bean:write name="strStripID" scope="request" /></b></font>
         <br><br>
         <font size="3" face="tahoma"><b>Bins Updater Tool:</b></font>
         <table border="1" width="365px" bgcolor="#1ea6f7" height="15">
              <tr>
                   <td valign="top" align="center">
                        <table><tr><td><font size="2">Select Bin Type:</font></td>
                        <td><select id="binType" onchange="updateBin()" size="1">
                             <OPTION></OPTION>
                             <OPTION value="green">Good Bin</OPTION>
                             <OPTION value="red">Reject Bin</OPTION>
                        </select></td></tr></table>
                   </td>
    </tr>
    </table>
    <table id="tbl" align="center" border="1" cellspacing="3" cellpadding="5" bgcolor="#CC9900">
    <tr>
    <td>                                                  
         <%for (int pnlrows=1; pnlrows<=intPanelRow; pnlrows++){%>     
              <table id="table" width="100%" border="1" bgcolor="#CC9900" cellspacing="7" cellpadding="0" align="center">
              <tr>
              <%for(int pnlcols=0; pnlcols<intPanelColumn;pnlcols++){%>               
              <td>
                        <%for (int rows=1;rows<=intRow; rows++){%>                    
                        <table cellspacing="5" width="100px" align="center" bgcolor="#CC9900">
                        <tr>
                             <td>                    
                             <%for(int cols=1; cols<intColumn; cols++){%>
                             </td>     
                             <td id="col" bgcolor="#008000" align="center" ondblclick="changeCol()"> X </td>          
                             <%}%>
                             <td id="row" bgcolor="#008000" align="center" ondblclick="changeRow()"> X </td>
                             <td></td>     
                             <%}%>                                                  
                        </tr>
                        </table>
              <%}%>
              </td>
              </tr>
              </table>     
         <%}%>
    </td>
    </tr>
    </table>
    and this is my javascript code:
         function updateBin()
              var binType=document.getElementById("binType")
              if(binType.value == "green")
              [binType.selectedIndex].value
              //binType = changeR();
              //alert('Good Bin Selected');
              if(binType.value == "red")
              [binType.selectedIndex].value
              //binType = changeC();
              //alert('Reject Bin Selected');
              if(binType.value == "")
                   alert('Please select only on the category!')
         function changeRow()
              if(binType.value=="green")
              x=document.getElementById('row').style.background="green";     
              alert('Updated!')     
              if(binType.value=="red")
              x=document.getElementById('row').style.background="red";
              //alert('Reject Bin Updated!')
         function changeCol()
              if(binType.value=="green")
                   x=document.getElementById('col').style.background="green";     
                   alert('Updated!')     
              if(binType.value=="red")
              x=document.getElementById('col').style.background="red";
              //alert('Reject Bin Updated!')
    this code only updates the first row and column..but the succeeding panel row and panel column can't update...what will i do? theres something wrong in my javascript or in my jsp...pls help me......thanx.....in advance!!

Maybe you are looking for

  • HP Officejet 7410 All-In-One Doesn't work after installing Snow Leopard

    installed Snow Leopard yesterday ....my HP 7410 printer doesn't work properly ....take a look at the response the HP Service Center gave me: +Hello Charles,+ +Thank you for contacting HP Total Care.+ +I understand from your email that you want the 'H

  • I can't open the JAVA webstart in WinXP (JSDK1.5.0beta2)

    When I click in javaws.exe the program opens the "Java application cache viewer" but does not load the Java Web Start. Someone know if it is a know bug or if is just of my own system?

  • Star Wars the Force Unleashed "Slow Motion (commonly known as a form of lag)"

         I have been attempting to run the game "Star Wars the Force Unleashed," on a 13-inch MacBook Pro Late 2011 with Intel Graphics HD 3000, 500 gb hard drive, 2.4 GHz processor speed, and 4 gig ram, and the game seems to be going in "slow motion (co

  • Wifi big problem

    in our office we have 2 x 16GB 3G IPHONES. one was bought 6 weeks ago, the other 2 weeks ago. both are updated to latest 2.0.2 update. in our office we have wireless, one has perfect signal and is connected and the other which is no more than 1foot a

  • Getting Server screenshot ... Apache Tomcat

    Hi, I am using this JSP code to get Sreenshot of the server from client browser. It works perfectly when I start the Apache tomcat using "C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.16\bin\startup.bat" The problem is dat it WONT wor