JButton and Changing Hover/Rollover Colors

Hello all,
I have a JFrame with JButtons that I set to a different color with: button.setForeground(Color.gray);
However, when I hover, rollover, or click there is an annoying blue color. I'm sure this is a very easy question. But I couldn't find anything in the API.
Any help would be great.
Thanks

Not sure it will help, but you can try
button.setFocusPainted(false);

Similar Messages

  • CS6 #nav links change hover background color based on its position in series

    First post from a complete DW CS 6 novice on Win7.  Not knowing JavaScript or JQuery, I thought I would add simplest animation to a website navigation based on the two col fixed header footer design. The navigation links on the left <sidebar1> have been increased to 24, with a common link background in the default state.  When the cursor is passed over the links they would change background color to one of five given in the image placed in the jpeg image loaded as the 1st list item.  The image itself only acts as a color key to the five catagories of links directly below it, and is not hyperlinked.  The idea is that someone looking for new tools would need to hover down the nav links and only be concerned with the Yellow background ones, even if they appear in any random position down the list.  To give each link a color to start with would make <sidebar1> appear too colorful.
    I have David Powers' two dvd titles and was thinking of using a nth-of-type() .  It does not work.  Perhaps there are two sets of colons required (  a:hover:nth-of-type(4), a:active:nth-of-type(4) {background-color:#f00;}   ).  There is surely a way that would work but I do not know enough of DW and CSS at present to figure this out.
    Many thanks.

    I don't what menu system you're using, but you might be able to create some CSS classes to use in your menu like so:
    <ul>
    <li>a href="some-link.html" class="about">about link</a></li>
    <li>a href="some-link.html" class="new">new link</a></li>
    <li>a href="some-link.html" class="new_proc">new procedures link</a></li>
    <ul>
    CSS:
    li a.about:hover {background-color:gray}
    li a:new:hover {background-color:forestgreen}
    li a:new_proc:hover {background-color:lawngreen}
    and so on...
    Nancy O.

  • Problem accessing child object and changing its appearance (color)

    For a program, I need to be able to access a child object (in this case a box) after adding it to a transform group and change its appearance, for example the color of its top face. I have included a small code example to show my problem. The box is the only child I have added to the TransformGroup, but when I call getChild(), it returns a node, and thus I can't then call getShape() to get the top face and change its appearance. What am I doing wrong?
    public BranchGroup createSceneGraph() {
         BranchGroup objRoot = new BranchGroup();
         Transform3D rotate = new Transform3D();
         Transform3D tempRotate = new Transform3D();
    rotate.rotX(Math.PI/4.0d);
         tempRotate.rotY(Math.PI/4.0d);
    rotate.mul(tempRotate);
         TransformGroup objRotate = new TransformGroup(rotate);
         objRoot.addChild(objRotate);
         Appearance ap = new Appearance();
         Appearance app = new Appearance();
         Appearance apr = new Appearance();
         ColoringAttributes colr = new ColoringAttributes();
         ColoringAttributes colg = new ColoringAttributes();
         colr.setColor((float)1, (float)0, (float)0);
         ap.setColoringAttributes(colr);
    colg.setColor((float)0,(float)1, 0);
         apr.setColoringAttributes(colg);
         Box box = new Box((float)0.4, (float)0.4, (float)0.4, app);
         box.getShape(4).setAppearance(ap);
         objRotate.addChild(box);
         objRotate.getChild(0).getShape(4).setAppearance(ap);
    objRoot.compile();
         return objRoot;
    }

    It would help if you gave us the following System information:
    Operating System/version
    Photoshop version number
    Amount of RAM installed
    Hard drive(s) capacity
    Make and model number of video card
    Also try resetting your preferences as described in the FAQ.
    http://forums.adobe.com/thread/375776?tstart=0
    You either have to physically delete (or rename) the preference files or, if using the Alt, Ctrl, and Shift method, be sure that you get a confirmation dialog.
    This resets all settings in Photoshop to factory defaults.
    A complete uninstall/re-install will not affect the preferences and a corrupt file there may be causing the problem.

  • CHANGING THE ROLLOVER COLOR

    Hi Friends,
    I got a template off the internet which I am using to design my webpage..but for some reason i dont know where to find the area to change the colour of the rollover in the template? The rollover is not an image - just plain text.
    have a look at pic attached. Basically when I rollover the text for eg: portfolio, the word "portfolio" changes from Blue to white. How do I change the rollover from white to another colour??? I cant find it I am sure its a simple solution.
    Any help will give me face of stoke!
    Cheers
    Wes

    hopeproject wrote:
    How do I change the rollover from white to another colour???
    You change the style definition. Look for something like a:hover in the style inside the document or the CSS that comes with it. If you can provide the code/ a link to the page, we can be more specific.
    Mylenium

  • How do I make a user shaped vignette move and change shape in Color

    I  want to isolate an irregular shaped area on screen by creating a vignette linked to a shape. The trouble is as the shape I want to isolate moves across the screen it changes size, orientation and shape. I know I can use keyframes when I'm using a round or square vignette but how can I track/keyframe a user defined shape?
    Thanks for any suggestions.

    Actually, I've sort of answered my own question. I've found out that having created a shape in the geometry room and attached it to a secondary correction tab, you can make the shape change shape, position and size. What you must do is to stay in the geometry room with the shape selected and then create key frames. At each keyframe you can alter the position of the points defining the shape. You can't however morph between different defined shapes.
    Hope that makes sense!

  • Alter css stylesheet to change rollover colors

    I know how to change the rollover colors for links that I've created myself using the inspector, than links/format tabs. But I'm customizing a blog using the notebook template, mostly because I liked the font that it used more than the other blogs. I'm not a big fan of the colors for the text and so I'd like to change the rollover text colors to #1f1a15 (normal) and 87595d (rollover). Is there come sort of stylesheet that I can alter so that the headline text for each entry on the blog home page (and in the archive) and the add a comment link at the end of each entry will match my color scheme?
    PS - I'd give you a link to the blog, but I can't publish it right now for some reason and I can't figure out what it is

    I don't think you can do it for blog pages and they don't take kindly to post publishing editing. I don't have a blog but all of the questions I've seen about modifying blogs were answered by those in the know as "No". You will lose your comments.
    Not if it's a new blog with no comments as yet you might be able to do it but if you had to ever make any changes to it via iWeb those rollover changes would be lost. I'd wait till one of those with experience with blog pages and changing css files respond to either confirm my post or shoot it down.
    OT

  • Having trouble with cutomizing hyperlink rollover color, visited, etc...

    i can create a hyperlink, then when i go to "format" i see i have options to change the rollover color (visited, etc.) but when i try to change anything, nothing works... it's all greyed out... any thoughts...?

    The formatting only work if you're selecting text as your hyperlink. If you've selected something else the formatting will be grayed out. So make sure you've selected text before going to the Link pane.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There's now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • How can I change the 'selected' color of one JToggleButton only.

    Hi,
    This seems like a simple / trivial question, but I just can't figure it out. Is there a way that I can create a JToggleButton and change the selected color of only that JToggleButton.
    I'm trying to create a simple sidebar like component for navigation within my app. A group of JToggleButton[s] added to a ButtonGroup (with the proper layout / sizing) works great, but the default JToggleButton colors don't suit my needs. I know that I can change the colors using the UIManager / UIDefaults, but I don't want to change the defaults for every JToggleButton in my app. I only want to change the defaults for a few select JToggleButton[s].
    For example, I can do this:
    UIManager.put("ToggleButton.select", UIManager.getColor("Table.selectionBackground"));
    UIManager.put("ToggleButton.background", UIManager.getColor("Table.background"));but I'd rather do something like this:
    JToggleButton jtb = new JToggleButton("Toggle Button Text");
    jtb.setSelectedColor(UIManager.getColor("Table.selectionBackground"));
    jtb.setBackground(UIManager.getColor("Table.background"));The only thing is, I can't find any method that is the equivilant of 'setSelectedColor(Color)' for JToggleButton.
    I know I could do it by adding some listeners to the JToggleButton[s], but that seems a little complicated for something like changing a color.
    I'd also seen a solution in the forums where someone had extended the ButtonUI of the pluggable look and feel they were using. I'm not interested in modifying the look and feel I'm using. As far as I'm concerned, that would defeat the purpose of having a pluggable look and feel as I would have to duplicate my efforts for every look and feel I want to use.
    Any help would be appreciated,
    Ryan

    try this
    import javax.swing.*;
    import java.awt.*;
    class Testing extends JFrame
      public Testing()
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(250,75);
        setLocation(400,300);
        JPanel jp = new JPanel();
        JToggleButton jtb = new JToggleButton("Toggle me");
        jtb.setUI(new MyUI());
        jp.add(jtb);
        getContentPane().add(jp);
      public static void main(String args[]){new Testing().setVisible(true);}
    class MyUI extends javax.swing.plaf.metal.MetalToggleButtonUI
      public Color getSelectColor(){return Color.BLACK;}
    }

  • Change the background color of a table created by ADDT (Login)

    I am trying to change the background color of a table in the login form created by the developer's toolbox. I then go and select the table and change the background color. But it has no effect. The only insight I have is when I delete this "" from the Action in the form, then the table's background color changes. As far as I can tell this line of code is only return the url of the page.
    I am not understanding something.
    Does anyone have any insight?
    Thanks!

    the table is linked using a CSS rule..
    the CSS rules comes from something called Skins..
    see mxkollection2.css.
    KT_XXX are the class ID's for table names.
    if u change this rule it will effect all the tables which use that rule in ur whole website.
    u can try switching skins from ADDT control panel.
    KT_tngtable is the tables css rule name defined in skins /Skinname/tng.css
    hope this helps u ..
    mohnkhan
    http://www.mohitech.com

  • How to change the font color in a strict type def programatically

    Could someone suggest a way to change the font color of a string indicator in a strict type def cluster programmatically? The cluster contains a label that is color-coded to match the function of the data channel represented by that cluster.  The function of each channel is not predetermined, so the font color needs to be changed programmatically.  To represent all channels, I have arranged a large cluster that contains 100 instances of the control.  This makes it essential that the control be strictly type defined in order to change the layout of the clusters uniformly.
    Can anyone suggest either a method by which I can let the control remain a strict type def and change the font color, or a method by which I can programmatically change the control from a strict type def to a type def?  Currently, I am saving the control as a strict type def every time I make a change and then saving it again as a type def when I am ready to run the program.  This works fine, but just seems inelegant.  This color-coding is used throughout the program in various indicators, so a neat solution would be greatly appreciated.

    As mentioned in my Nugget on Type definitions you can create strict type-defs that contain type-defs.
    If you make your data definition a type and put that definition in a strict type-def (one of each flavor) you can use the appropraite strict type where each is required.
    Yes the data structure will have another level of nesting so if you are "too far gone" you may not like this idea.
    Otherwise you can write a VI that opens the typed-def and do a "save as..." and use it everytime you edit the type-def.
    I hope something helps!
    Ben
    Message Edited by Ben on 10-06-2008 10:26 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Strict_of_Typedefs.PNG ‏30 KB

  • Changing ruler guide color not working

    Having an issue when I go to Layout > Ruler guides and change the ruler guide color, it doesn't update on the canvas and the color is still this mint green which is hard to see against a white background. Any idea on how to fix this?

    yeah i went into preferences and changed all the colors in there too, but the one for ruler guides isn't in preferences its under layout > ruler guides. not sure why its not updating

  • Changing the column color

    Hi ,
    would I be able to change the complete column color
    dynamically (it does'nt work using the Advanced Datagrid --
    styleFunction property) I am able to change the color of the
    text of a specific column dynamically (
    http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_04.html#230321)
    but not the background color of the column.
    Can any body provide some help on this (changing the
    background color of the column dynamically)
    thanks

    "nash99" <[email protected]> wrote in
    message
    news:gfhuls$s1c$[email protected]..
    > Hi ,
    > would I be able to change the complete column color
    dynamically (it
    > does'nt work using the Advanced Datagrid --
    > styleFunction property) I am able to change the color of
    the text of a
    > specific column dynamically
    > (
    http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_04.html#230
    > 321) but not the background color of the column.
    >
    > Can any body provide some help on this (changing the
    background color of
    > the
    > column dynamically)
    Just look and see what column it is and change its background
    color...

  • Change roll-over color of combobox?

    Hey everyone.
    I have a simple question. What is the property of the combo
    box component that can change the RGB value of the roll over of a
    combo box to change it from the defalt green?

    combobox.setStyle("themeColor", "0x990000");
    put this code on your timeline where you have the compnent
    instantized.
    change name "combobox" to your component instance name and
    change the hex color "0x990000" to color desired...you have to have
    the "0x" before the hex for it to work

  • Change footer font color with embedded form?

    How do I change the font color on the footer of a form in FormsCentral?
    When I developed the form I was using a design that looked great in a standalone format, but we're considering embedding the form. When I went to embed the form, the links at the bottom became useless because the font in the footer is white (see attached screen shots).

    Hi,
      In order to see the background color of the form, you will have to enable it.
    Open the form in FormsCentral, go to Distribute tab / Embed sub tab and check : "Include page background color" check box.
    >>How do I change the font color on the footer of a form in FormsCentral?
    You will need to change the text color of your form header.  Open the form in FormsCentral, select Design Tab, select the form header, select the text and change the text color to other-than-white via the Toolbar.
    Hope this works for you,
    Thanks,
    Lucia

  • How can I make multi-colored links change their rollover or hover color?

    I have made links with seperate colors using css, but the links with new colors have no hover property. I want these links to change color when the cursor hovers over them the same way the other links on my page do. I have tried making a new css rule for <hover> and tried writing the property into the css code but to no effect. I have searched the web and this forum for an answer and found notheing that works. Does anyone know how to give links with multiple colors a hover property that will make them change color? All of my other links change color as defined in the page properties, but the links with new color rules don't change color anymore. This is probably pretty basic. I'm new to DW, using CS6. If anyone can provide a step by step and show where the code should be inserted, this would be very helpful. Thank you in advance!

    Basic HTML5 Layout with Multi-colored menu.
    Copy & paste the code below into a new, blank document.  SaveAs test.html.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 Document</title>
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <![endif]-->
    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <style>
        box-sizing: border-box;
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
    body {
        font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
        font-size: 62.50%;
        width: 900px;
        /**with width, this is centered**/
        margin: 20px auto;
        padding: 0;
        background: #CCC099;
        box-shadow: 3px 3px 12px #333;
        border-radius: 12px;
    /**TEXT LINKS**/
    a {
        text-decoration: none;
        font-weight: bold;
        color: #F63
    a:visited { color: #F93 }
    a:hover, a:active, a:focus { text-decoration: underline }
    header {
        margin: 0;
        padding: 0;
        min-height: 100px;
        border-radius: 12px 12px 0 0;
        color: #FFF;
        background: url(http://lorempixel.com/output/abstract-q-c-1056-100-7.jpg) no-repeat;
    /* Multi-colored Horizontal Drop-Menu */
    nav {
        float: right;
        padding: 4px;
        text-align: center;
        background: rgba(0,0,0,0.3)
    nav ul {
        margin: 0;
        padding: 0
    nav li {
        list-style: none;
        font-size: 12px;
        float: left;
        text-align: center;
    /**top level menu**/
    nav li a {
        display: block;
        text-decoration: none;
        margin-right: 0; /* space between links */
        width: 10em; /* adjust as needed or use auto */
        padding: 8px;
        font-weight: bold;
        line-height: 1.50em;
        border-top: none;
        color: #000;
    /**alternating background colors**/
    nav li:nth-child(odd) > a { background: #CAD3D3 }
    nav li:nth-child(even) > a { background: #FFCCCC }
    /**top menu style on mouse over**/
    nav li:hover > a {
        color: #FFF;
        background: #033D53;
    /**sub-menu**/
    nav li ul {
        display: none;
        text-align: center;
        margin: 0;
        padding: 0 1em;
        background: none;
    /**sub-menu, help for older IE**/
    nav li:hover ul, nav li.hover ul {
        display: block;
        position: absolute;
        padding: 0;
    nav li:hover li, nav li.hover li { float: none; }
    /**drop-menu style**/
    nav li:hover li a, nav li.hover li a {
        width: 10em; /* adjust width as needed or use auto */
        margin-top: 0;
    /**drop-menu style on mouse over**/
    nav li li a:hover {
        background: #D3E1B7;
        color: #004A43;
    /* Clear floated elements at the end*/
    nav:after {
        display: table;
        content: '';
        clear: both;
    /**END DROP-MENUS STYLES**/
    article {
        background: #FFC;
        padding: 3%;
        font-size: 125%;
    /**3-COLUMNS**/
    section {
        float: left;
        width: 33.33%;
        padding: 1%;
        background: #EAEAEA;
        min-height: 250px;
    /**alternating background-colors**/
    section:nth-child(even) { background: #DADADA; }
    footer {
        clear: left;
        color: #FFF;
        background: #033D53;
        font-size: small;
        font-weight: bold;
        text-align: center;
        padding: 1%;
        border-radius: 0 0 12px 12px;
    /**text styles**/
    p {
        margin: 0 0 1.5em 0;
        padding: 0;
        font-size: 1em;
    /**header text**/
    h1 {
        margin: 0;
        padding: 0.5em 1% 0;
    h2 {
        margin: 0;
        padding: 0 1%;
        font-style: oblique
    h3 {
        margin: 0;
        padding: 0;
        font-size: 1.5em;
        color: #09F;
    </style>
    </head>
    <body>
    <header> <h1>Site Name</h1> <h2>Some Pithy Slogan</h2>
    <!--begin top menu-->
    <nav>
    <ul>
    <li><a href="#">ABOUT US &#9660;</a>
    <ul>
    <li><a href="#">Videos</a></li>
    <li><a href="#">Newsletter</a></li>
    </ul>
    </li>
    <li><a href="#">PRODUCTS &#9660;</a>
    <ul>
    <li><a href="#">Broken Glass</a></li>
    <li><a href="#">Mosaic Tiles</a></li>
    <li><a href="#">Adhesives</a></li>
    <li><a href="#">Grout</a></li>
    </ul>
    </li>
    <li><a href="#">ACCESSORIES &#9660;</a>
    <ul>
    <li><a href="#">Gloves</a></li>
    <li><a href="#">Rubber Mallets</a></li>
    <li><a href="#">Sponges</a></li>
    <li><a href="#">Safety Glasses</a></li>
    </ul>
    </li>
    <li><a href="#">CONTACT</a></li>
    </ul>
    </nav>
    <!--end top menu-->
    </header>
    <article>
    <h3>Main Content goes here...</h3>
    <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vitae libero lacus, vel hendrerit nisi! Maecenas quis velit nisl, volutpat viverra felis. Vestibulum luctus mauris sed sem dapibus luctus.</p>
    </article>
    <!--3-columns-->
    <section> <h3>Heading 3</h3>
    <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vitae libero lacus, vel hendrerit nisi! Maecenas quis velit nisl, volutpat viverra felis. Vestibulum luctus mauris sed sem dapibus luctus.</p>
    <ul>
    <li><a href="#">some link</a></li>
    <li><a href="#">some link</a></li>
    <li><a href="#">some link</a></li>
    </ul>
    </section>
    <section>
    <h3>Heading 3</h3>
    <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vitae libero lacus, vel hendrerit nisi!
    Maecenas quis velit nisl, volutpat viverra felis. Vestibulum luctus mauris sed sem dapibus luctus.
    Pellentesque aliquet aliquet ligula, et sagittis justo auctor varius. Quisque varius scelerisque nunc eget rhoncus.
    Aenean tristique enim ut ante dignissim. </p>
    </section>
    <section>
    <h3>Heading 3</h3>
    <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vitae libero lacus, vel hendrerit nisi!  Maecenas quis velit nisl, volutpat viverra felis.  Vestibulum luctus mauris sed sem dapibus luctus.  Pellentesque aliquet aliquet ligula, et sagittis justo auctor varius.  Quisque varius scelerisque nunc eget rhoncus.  Aenean tristique enim ut ante dignissim. </p>
    </section>
    <!--end 3-columns-->
    <footer>
    <address>
    Company address . Phone . Fax
    </address>
    <small>&copy; 2014 SiteName. All rights reserved</small>
    <p> </p>
    <p> <a href="http://jigsaw.w3.org/css-validator/check/referer"> <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
    alt="Valid CSS!"> </a> <img src="http://www.w3.org/html/logo/badge/html5-badge-h-css3-semantics.png" height="31" alt="Valid HTML5"></p>
    </footer>
    </body>
    </html>
    Nancy O.

Maybe you are looking for

  • The usage about "vendor line item display"(FBL1N)

    Hi, The field of "amount in local currency" in the above list is a amount including tax, Is there any way to display the amount tax amount and AP amount without tax respectively ? Thank you !

  • Acrobat 9 Pro: Message "An error exists on this page. Acrobat may not display page correctly. Please

    Over the past week, I have received pdfs from 2 different graphic design contractors that do not open correctly in Acrobat 9 Pro. There is an error in the document and when I scroll to the page where the error is, I get: An error exists on this page.

  • Crystal Reports - ECC - SSO Issue

    Team, System Details. 1. BOE XI 3.1 SP3 2. Crystal Reports 2008 3. SAP ECC 6.0 4. SAP NW 7.x Scenario: Crystal reports running against ECC system. SSO configured on Crystal Report database configuration option, report is accessed through SAP NW porta

  • Regarding dates and selection screen

    Hi all, In my selection screen i have 2 date fields(ranges). I have a requirement wherein i have to allow user to select only one date i.e. let the date fields be date1 and date2 when the user enters date1 he should not be allowed to enter date2 and

  • Dynamic PartnerLink ?

    Well, when I am developing my business process, I wish to use one partnerlink to call different BPELs dynamically. So I find the sample of DynamicPartnerLink. But actually it is not what i need. I mean based on the sample I need to rewrite a partnerl