Getting a JPanels Background Color?

Hi guys,
Can anyone teach me how to know what background colour a JPanel has?
I tried panel.getBackground(). but no luck so far....
is there another way to achieve this?
thank you very much!

getBackground() returns background in RGB constraints.
Since the objects in the Color class eg:
     * The color white.  In the default sRGB space.
    public final static Color white     = new Color(255, 255, 255);are pre-defined(named) based on the RGB, one can directly use those objects.
So you won't to get the color directly for the JPanel instead you will get the RGB values.
Hope this helps you.

Similar Messages

  • Is there any way to get the black background color back in fullscreen mode?

    The current background color in fullscreen mode is grey and it's distracting.  It used to be black.  Is there a way to change the color outside of the document boundaries?

    AndyboyMac wrote:
    The only way you can get themes for your ipod is by a jailbrake, jailbraking is illegal, and yes,, you can downgrade your iOS.
    Jailbreaking is actually not illegal due to exemptions in the DMCA documentation (http://en.wikipedia.org/wiki/IOS_jailbreaking#cite_note-22).
    I've got no explanation on to why the trusty interface for the old iPod style app was butchered, unfortunately (I think we're all at a loss, besides someone being given too much free reign). I came here to supplement the original question with, another alternative question:
    Is there a way, similar to downgrading 3rd party apps, downgrade the Music app or restore the old iPod app as an additonal app? Without jailbreaking?
    < Edited By Host >

  • Getting current terminal background color

    is there any way to retrieve the current background color in the active terminal (xterm/konsole/whatever)? preferably in c.
    tnx.

    in C it wouldn't be that hard, however it gets difficult when you talk about different WMs...
    Basically, you iterate over each top level window (the frame)... but you'd need a way to determin which child of the fram is the application (the title bar, buttons, and possibly status bar are all children as well).
    Then you just call a "property get" on the app window...
    the main difficulty is going to be different window managers...

  • How to get the foreground/background color in photoshop.

    I want to get the foreground or background color at runtime ( by any action ) in photoshop.
    What steps should I follow.

    For example here is a script I use within Photoshop Actions to save and restore the users foreground and background colors so the action can mess with Photoshops foreground and background colors during its processing.
    SaveAndRestoreColors.jsx
    /* ======================================================================================
    // 2009  John J. McAssey (JJMack)  http://www.mouseprints.net/
    // This script is supplied as is. It is provided as freeware.
    // The author accepts no liability for any problems arising from its use.
    // This script is designed to be used by a Photoshop Action twice
    // A good pratice to use when creating an actions that use this scipt is for the action
    // not to do a save or play some other action between its two useages of this Script.
    // The first time this script is used by an action Photoshops Current Forground
    // and Background Colors are saved into the document's meta-data Info Instructions field.
    // The second time this script used by the action the script retreives what was
    // saved in the meta-data during the first usage and these colors are set.
    // and the saved data is removed from the document's meta-data Info Instructions field.
    // ===================================================================================== */
    <javascriptresource>
    <about>$$$/JavaScripts/SaveAndRestoreColors/About=JJMack's SaveAndRestoreColors.^r^rCopyright 2009 Mouseprints.^r^rRun twice script utility for action.^rNOTE:Don't play other actions between runs!^r^rFirst Run records Photoshops foreground and background swatch colors.^rSecond Run restores the recorded colors and removes the recording.</about>
    <category>JJMack's Action Run Twice Utility</category>
    </javascriptresource>
    if (app.documents.length > 0) {
    if (app.activeDocument.info.instructions.indexOf("<Colorf>") == -1 ){ // no footprint fisrt useage
    //alert("first");
    // Retreive Document information for Foot Print
    saveforeColor = new SolidColor;
    saveforeColor.rgb.red = app.foregroundColor.rgb.red;
    saveforeColor.rgb.green = app.foregroundColor.rgb.green;
    saveforeColor.rgb.blue = app.foregroundColor.rgb.blue;
    savebackColor = new SolidColor;
    savebackColor.rgb.red = app.backgroundColor.rgb.red;
    savebackColor.rgb.green = app.backgroundColor.rgb.green;
    savebackColor.rgb.blue = app.backgroundColor.rgb.blue;
    // put footprint in metadata info instructions
    app.activeDocument.info.instructions = app.activeDocument.info.instructions + "<Colorf>" + saveforeColor.rgb.red + "," + saveforeColor.rgb.green + "," + saveforeColor.rgb.blue + "</Colorf>" + "<Colorb>" + savebackColor.rgb.red + "," + savebackColor.rgb.green + "," + savebackColor.rgb.blue + "</Colorb>";
    //alert( "Saved ="  + "<Colorf>" + saveforeColor.rgb.red + "," + saveforeColor.rgb.green + "," + saveforeColor.rgb.blue + "</Colorf>" + "<Colorb>" + savebackColor.rgb.red + "," + savebackColor.rgb.green + "," + savebackColor.rgb.blue + "</Colorb>");
    else {
    //alert("second");
    // Retreive saved information
    colorfOffset = app.activeDocument.info.instructions.indexOf("<Colorf>") + "<Colorf>".length;
    colorfLength = app.activeDocument.info.instructions.indexOf("</Colorf") -colorfOffset;
    saveforeColor = app.activeDocument.info.instructions.substr(colorfOffset, colorfLength);
    colorbOffset = app.activeDocument.info.instructions.indexOf("<Colorb>") + "<Colorb>".length;
    colorbLength = app.activeDocument.info.instructions.indexOf("</Colorb") -colorbOffset;
    savebackColor = app.activeDocument.info.instructions.substr(colorbOffset, colorbLength);
    //alert("Colorf = " + saveforeColor + " Colorb = " + savebackColor );
    // Restore Colors
    app.foregroundColor.rgb.red = saveforeColor.substr(0,saveforeColor.indexOf(","));
    saveforeColor = saveforeColor.substr(saveforeColor.indexOf(",") + 1,saveforeColor.length);
    app.foregroundColor.rgb.green = saveforeColor.substr(0,saveforeColor.indexOf(","));
    saveforeColor = saveforeColor.substr(saveforeColor.indexOf(",") + 1,saveforeColor.length);
    app.foregroundColor.rgb.blue = saveforeColor ;
    app.backgroundColor.rgb.red = savebackColor.substr(0,savebackColor.indexOf(","));
    savebackColor = savebackColor.substr((savebackColor.indexOf(",") + 1),savebackColor.length);
    app.backgroundColor.rgb.green = savebackColor.substr(0,savebackColor.indexOf(","));
    savebackColor = savebackColor.substr(savebackColor.indexOf(",") + 1,savebackColor.length);
    app.backgroundColor.rgb.blue = savebackColor ;
    // Remove footprint from metadata info instructions
    before = app.activeDocument.info.instructions.substr(0,app.activeDocument.info.instructions.indexO f("<Colorf>"));
    afterOffset = app.activeDocument.info.instructions.indexOf("</Colorb>") + "</Colorb>".length;
    after = app.activeDocument.info.instructions.substr(afterOffset, app.activeDocument.info.instructions.length - afterOffset);
    //alert ("before = " + before + " after = " + after);
    app.activeDocument.info.instructions = before + after;
    else { alert("You must have at least one open document to run this script!"); }

  • Get/read stage background color

    hello one and all,
    how do you read or get the stage's background color?
    then, how do you set the fill color of that stage color to a drawing object under a movieclip symbol?
    using flash cs4 and as3.
    lucas

    use a movieclip or sprite at depth 0 to cover the stage and control its color.

  • How do I get a different background color in the dock in Mavericks?

    Has anyone figured out how to change the background color in the dock?  The default is really bad and hard to read.

    dont know how but looking at this video, this guy sems to have a solution
    => http://www.youtube.com/watch?v=TXwGP9hkHDQ&ytsession=1uKskJuFULWJ4S9dtlGhOuS2K1F egefIt4_t4UMOVdnn24KtXByipkEVNKRIm0un6jlloUu8at22J1pboQ56RPHKX0Sp1PkvfCtVKga_f9H NN9n104j5psKQFS4q8yBii2OiaZ8IXqXmGIkXmXs_DD2ypL-Er4kRe2YLnEBIpbv9kNbkFSsNsZu_BXu 8qGqQ7H4WCxq4m3yevxbUhY6G-f-5rWtrERD6o4oCB-OOGs1_BzgpsfxT9JYZBIhx53EgZpsNQEdVvPL USgXhw82EdXYwwpuJs0gLawJV1gWEE2Q
    if you look at his dock, it's not silver bright but blue and he add a line before the trash

  • How do I get rid of background color in shortdesc

    Every time I remove the background color from the short.description paragraph tag, it comes back when I reopen FrameMaker. I don't want any background colors in my short descriptions.

    Ah .. FM10 and DITA 1.2 .. too bad, you're in for a bit of a chore.
    The 1.2 apps are here .. AdobeFrameMaker10\Structure\xml\DITA_1.2\
    Unfortunately, there are lots of them, and it's not immediately clear how to approach things. Opening an XML file in Frame requires a structured application in order to define the valid document model and to apply the proper formatting. The formatting is applied by an EDD, which defines the mapping from elements and associated styles which live in the template (the EDD itself is embedded in the template as well). The structured applications are defined in the structapps.fm file (of which there are two). One of these can be seen when you choose the Structure Tools > Edit Application Definitions file (this lives in the user's "app data" area), but another is at AdobeFrameMaker10\Structure\structapps.fm (this is the "core" structapps file). The two files define the available structure applications, any definitions in the user's file override those in the other file (I'm pretty sure).
    So .. when you open an XML file, Frame scans the structapps files for matching doctypes, if only one is found, that app is used. If multiple matching doctypes are found, you are presented with a dialog that lets you choose from the available apps. If you didn't select an app when opening the file, you'll need to look in the structapp files to see which one was used for your file. The root element in your file defines the doctype (as well as the Public ID). If this is a "task" topic, you'd look in the structapp files for matching apps that support the "task" doctype (if you're using DITA 1.2 you'll be looking for a DITA 1.2 task .. I'm not totally clear on how FM differentiates between the two). In my installation the DITA 1.2 definitions are in the core structapps file, but it could be in either place (or both).
    Once you locate the structure app definition, it will have nodes that define the Template, the DTD, the ReadWriteRules, and other things. You're just looking for the template though. If you're using a "task", for DITA 1.2 that's likely to  be the DITA_1.2_task structure application .. the template is located at ..
         $STRUCTDIR\xml\DITA_1.2\app\technicalContent\template\task.template.fm
    where "$STRUCTDIR" is the location of the FrameMaker\Structure folder (or possibly defined differently in the maker.ini .. but that's a different issue).
    Editing this one file will affect the formatting of future task topics you open. You'll have to do the same thing in the other corresponding topic type templates to affect all of the topics.
    In previous versions of Frame, it used the "ditabase" model for authoring and publishing. This encapsulates all of the models in one file making it much easier to maintain. This model is more parallel to the DITA model, but will be a real nightmare for people to customize. I'm not going to begin to try and explain how you'd clone these apps to make your own, although you can read a document written for DITA-FMx and DITA 1.1 that gives you the fundamental process ..
         http://docs.leximation.com/dita-fmx/1.1/?ditafmx_cloningtapps.html
    I'm hoping that I've explained this correctly .. I'm still trying to wrap my head around it myself.
    Cheers?
    ...scott

  • How to get secondary tile background color on WP 8.1?

    Currently, all secondary tiles are returning background color #7FFFFFFF regardless of color

    Hi TaskBasic,
    >>all secondary tiles are returning background color #7FFFFFFF regardless of color
    We can use the following code to convert HEX color to Color in runtime:
    var hexCode = "#7FFFFFFF";
    var color = new Color();
    color.A = byte.Parse(hexCode.Substring(1, 2), NumberStyles.AllowHexSpecifier);
    color.R = byte.Parse(hexCode.Substring(3, 2), NumberStyles.AllowHexSpecifier);
    color.G = byte.Parse(hexCode.Substring(5, 2), NumberStyles.AllowHexSpecifier);
    color.B = byte.Parse(hexCode.Substring(7, 2), NumberStyles.AllowHexSpecifier);
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do I get rid of background color in a table?

    I insert a table and it shows up with a blue background.  The properties panel shows no background selected.  I changed it to a white background but nothing happened.  I made a new class named tableformat, it took all the styles I applied to the class except the background, still blue.  Here is the code:
    <table width="600" border="1" cellpadding="3">
                <tr>
                  <th scope="col"> </th>
                  <th scope="col"> </th>
                  <th scope="col"> </th>
                </tr>
                <tr>
                  <td> </td>
                  <td> </td>
                  <td> </td>
                </tr>
                <tr>
                  <td> </td>
                  <td> </td>
                  <td> </td>
                </tr>
              </table>
              <p align="left"> </p>
              <p> </p>
    Thank you in advance for any help anyone can give me.

    Here is code for the page with the table:
    <title>Biological Sciences - Home</title>
    <style type="text/css">
    </style>
    <link href="CSS/Style.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <div id="header"><img src="images/header.jpg" width="900" height="200" alt="Biology Department" /></div>
      <div id="MainNav">
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="welcome.html">Welcome</a>      </li>
          <li><a href="faculty.html">Faculty/Staff</a></li>
          <li><a class="MenuBarItemSubmenu" href="programs.html">Programs</a>
            <ul>
              <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
                <ul>
                  <li><a href="#">Item 3.1.1</a></li>
                  <li><a href="#">Item 3.1.2</a></li>
                </ul>
              </li>
              <li><a href="#">Item 3.2</a></li>
              <li><a href="#">Item 3.3</a></li>
            </ul>
          </li>
          <li><a href="resources.html">Student Resources</a></li>
          <li><a href="#">Clubs</a></li>
          <li><a href="#">COC Links</a></li>
          <li><a href="contact.html">Contact</a></li>
        </ul>
      </div>
      <div id="content">
        <p>Content for  id "content" Goes Here</p>
        <table width="600" border="1" cellpadding="3">
          <tr>
            <th scope="col"> </th>
            <th scope="col"> </th>
            <th scope="col"> </th>
          </tr>
          <tr>
            <td> </td>
            <td> </td>
            <td> </td>
          </tr>
          <tr>
            <td> </td>
            <td> </td>
            <td> </td>
          </tr>
        </table>
        <p> </p>
        <p> </p>
      </div>
      <div id="footer"><img src="images/footer.jpg" width="772" height="297" alt="Aliso Lab" /></div>
    Content for  id "wrapper" Goes Here</div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>

  • Getting the hex colour code of a Jpanel background colour

    Hello,
    I have been attempting to retreive the hex colour code of a jPanel's background colour, so far I have the code
    Integer.toHexString(jPanelgetBackground().getRGB()));However this is returning an 8 digit string (for example. if the jpanels background color is white, this will return ffffffff instead of a the six digit value ffffff that I want. If I try black 000000 my code returns ff000000.
    I am trying to retreive the colour and then use it in a CSS file. However every time there is an extra ff added to the start of the string. Where am I going wrong?

    Integer.toHexString(jPanel.getBackground().getRGB() & 0xffffff);Message was edited by:
    sabre150

  • Problem printing to jpg - only get background color

    Sometimes when I print to a jpg all I get is the background color.  I can't see any pattern as to when this occurs and when it doesn't.  (LR4, Win7, original files are CR2) Any clues?
    thx,
    John

    No question mark - all appears normal in the Library and Develop Modules, regardless of the view.  There's no indication that it will happen prior to it happening that I've been able to detect.  The black files are quite small (40k - 50k as I recall) which is reasonable for a solid color jpg.

  • Background color for column heading

    Hi,
    I have 5 columns in my report and I would like to have different background color for column headings. How can I do this in report templates?
    I was looking at Column heading section-
    <th class="t10ReportHeader"#ALIGNMENT# id="#COLUMN_HEADER_NAME#">#COLUMN_HEADER#</th>
    How can I specify backgrund colors for all columns here?
    Thanks in advance

    G'day Karen,
    Thanks for ur reply.
    I have seen this note before, its not that the header colors have changed after latest SP was applied in our systems. Also the ABAP and JAVA stacks are in sync.
    Scenario is that we are trying to set up a new Portal theme for Enterprise Reporting with some specific color codes (hex codes).
    What i have observed is Characterstics Header background color is set up using the element "Background Color of Level 1 Column Heading ".
    While the Background color for Key Figures header is using element "Background Color of Level 2 Column Heading ".
    But the problem is element "Background Color of Level 2 Column Heading " is also used as the Background color for Standard Characterstics cell, so if we make it same the whole report of the same color, which we dont want.
    Requirement is to get the same Background color for Header cells (both Char. and Key Figure headers).
    Any further suggestions will be appreciated.
    Thanks
    CK

  • 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 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

  • Background color popup

    Hi specialists
    In our WD4a application we use a popup view to display detailed info for an object.
    In the portal we ue our own theme to make the views look like our company wants them to look.
    However, the popup gets a diferent background color (standard color) then the main views.
    Is there a guru who knows how to set the background color for popups?
    I can't find the dedicated settings in the portal theme editor.
    Thans in advance
    Wouter Heuvelmans
    Pyramid Applied Solutions

    see this it may help..
    /people/christopher.solomon/blog/2007/08/20/hacking-the-new-portal-iview-personalization-feature

Maybe you are looking for

  • Cant see Business Rules after restore

    Hi - using Business Rules 3.5.1 - we are trying to refresh our development Business Rules with our Production Business Rules. DBAdmins did the restore and if I go looking in the sql tables, I do see the rules. But when I go into the Business RUles De

  • Announcing Oracle Portal Studio

    Oracle Portal Studio is a hosted service that provides you a platform for registering and testing your web providers, without needing your own Oracle Portal instance! Try it out at http://portalstudio.oracle.com/

  • Help!  Replace form portlet with report portlet

    I have a page with 2 column regions. The right region contains a form portlet based on a stored procedure. When the user submits the form data, I would like the stored procedure to replace the form portlet with the report portlet results. How can I d

  • Sorting images in camera raw

    It sounds silly but I cannot find a way to put my imported images into number order in camera raw. They seem to put themselves into a random order which I cannot seem to change. Is there a setting that puts them into size, date, or number order? (Ver

  • Digital edition crashes when i try to print

    I have downloaded digital editions on a Mac(Leopard OS). I can view items, but the application crashes when I try to print