Solution to setRollOverIcon (for JButton) problem

Hi all,
I've seen a lot of posts asking why setRolloverIcon() didn't work. I had the same problem, and after looking throught the SwingSet example, I found the solution.
So far, the only way that I've been able to get the rollover icon to work is through the following code:
JToolBar toolBar = new JToolBar();
JButton button = new JButton(defaultImage);
toolBar.add(button);
button.setRolloverIcon(rolloverImage);
...I don't know why, but if you set the rollover icon before you add the button to the toolbar (or whichever component you add the button to), the rollover icon doesn't work.
Hope this helps.

This is the class I generally use for toolbars.
* Toolbar.java
* Created on 29 September 2002, 21:01
package org.argouml.ui;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.Insets;
* @author  Bob Tarling
public class Toolbar extends JToolBar {
    /** Creates a new instance of Toolbar */
    public Toolbar(String title) {
        this.setFloatable(true);
        this.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
        this.setMargin(new Insets(0,0,0,0));
    /** Creates a new instance of Toolbar */
    public Toolbar() {
        super();
        this.setFloatable(false);
        this.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
        this.setMargin(new Insets(0,0,0,0));
    public Toolbar(int orientation) {
        super(orientation);
        this.setFloatable(false);
        this.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
        this.setMargin(new Insets(0,0,0,0));
}

Similar Messages

  • My iTunes just started skipping when a song is played.   has a solution been found for this problem yet?

    My itunes started skipping when a song is played.  Has a solution been fournd for this problem yet?

    For the missing Artists on your iPod, make sure their tracks in iTunes are not marked as "Part of a compilation" in iTunes. You can do this by highlighting the track, right->clicking on them and choosing "Get Info" from the shortcut menu. When the window pops up, head over to the Info tab and make sure there is NO tick mark next to this option in the lower right hand corner. Lastly, sync the updated changes to your iPod.
    B-rock

  • Problem in Setting Background Color for JButton

    Hi,
    I am using Background color for JButton (color is selected from the customized JColorChooser created by us) where it contains the option of transparency. If we choose light color, then the background is set to JButton, but when we mouse-over the JButton, other components inside the container (JPanel) is getting displayed inside the button.
    Can anyone help to sort out this problem.
    Thanks in advance.

    Hi,
    Here is the code.
    DialogWrapper is JDialog and ColorEditorPane is JPanel.
    DialogWrapper     dlg         = new DialogWrapper();
    ColorEditorPane colorPanel = new ColorEditorPane();
    colorPanel.setValue( _data.getTransparentColor());
    dlg.showWrappedDialog( colorPanel, "color_help", "color_dialog" );
    if( dlg.isOK())
    Color chosenColor = (Color) colorPanel.getValue().getContent();
    _data.setTransparentColor( chosenColor );
    _transparentColorDisplay.setBackground( chosenColor );
    _transparentColorDisplay.setOpaque( true );
    this.repaint();
    this.doLayout();
    this.validate();
    }I've several components like JCheckBox, JRadioButton, JTextField in "this".

  • TA24002 My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know which erase option would be the best solution for this problem.

    My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know what option would be the best solution for this problem?

    You appear to have two issues: 1) a hard drive that is not working properly and 2) files you wish to recover.
    Re 1) you need to answer Kappy's questions.
    Re 2) does the drive load and can you see your photo files? If so can you copy them to another drive?
    Do you not have a backup of the photo files?

  • I have problems in the initiation of the Encore process when opening presents the following error message : "Encore CS6 Cannot Run in Non-Royalty Serialized".... What is the best solution for this problem ?

    Help Me.
    What is the best solution for this problem ?

    Encore is activated when you activate Premiere Pro... so, as Stan asked, how did you install P-Pro?
    Ask for serial number http://forums.adobe.com/thread/1234635 has a FAQ link
    -and a fix for Encore http://forums.adobe.com/thread/1421765?tstart=0 in reply #7
    -plus more Encore http://helpx.adobe.com/encore/kb/cant-write-image-fie-larger1.html

  • I bought my iphone 5 in Houston Texas May 15 2013 IMEI Nr. 013428009645399.The problem is that in the Greece the country which I live the 4G is not working.If you have any solution for this problem pls. let me know.My email is philcoueth@yahoo.gr Thank yo

    I bought my iphone 5 in Houston on May 15 2013.
    IMEI 013428009645399.The problem I have is that in the country
    which I live GREECE the 4G is
    not working.Please if you have any solution for this
    problem let me know.My email is [email protected]
    Thanking you in advance
    Philip Couridis

    iPhones purchased in the US are NOT guaranteed to work with 4G bands outside of North America.
    For what crazy reason did you purchase an iPhone in the US if you live in Greece?  If your phone needs servicing, it will have to be brought back to the US.  You cannot get that phone serviced in Greece.

  • SOLUTION for my problems with MSI Z77A-GD65 + MSI N670 PE 2GD5/OC

    Lately I had problems with my GTX 670 video card (MSI N670 PE 2GD5/OC) under Windows 7 Pro x64.
    I got a lot of "Display driver stopped responding and has recovered" errors.
    I had these errors once or twice a day, so I didn't really  bother looking for an answer, also I couldn't reproduce the error.
    Most games just worked fine, but not always... so I tried if I could reproduce the error.
    I tried to stress test with MSI Kombustor and voila no windows error... noo... but the core voltage went to 0 mV within a minute and everything (screen / windows / kombustor) stuttered and I had to restart the system.
    The strange thing was that the voltage went to 0 mV, but the GPU load went from 96% - 60% and back to 96%... why and how is this possible??
    Now I could reproduce my problem... yes!
    First I thought it was a driver problem, because I updated it to the newest version (310.70), so I tried to re-install an older driver and also the original MSI driver... no luck.
    Maybe it could be a mainboard driver or some settings in windows, so I installed Windows 8... no luck.
    Re-installed Windows 7 Pro x64 (basically because Windows 8 s*cks)... no luck.
    I tried to put my video card in another system and there was no problem... so I thought my video card is not broken...
    Maybe it's my my power supply... new power supply... no luck again... grrrr...
    My solution was downgrading / flashing my mainboard (MSI Z77A-GD65) bios back to 1.5 instead of 1.7, because yes... live update had updated my bios... that was the problem.
    I wanted to post this, because I couldn't really find the answer for my problem and maybe I can help a few people with the same configuration and problems.
    Live well and... well you get the idea 

    Quote from: flobelix on 21-August-13, 04:12:05
    Don't use TF II/TF III parts as they won't fit. Arctic Accelero Twin Turbo II or Accelero Mono PLUS are good value for money aftermarket solutions.
    Thank you for the information and advice.  As I was looking into those two, I noticed that Accelero's website claimed the Accelero Xtreme III would also fit, and NewEgg had it on sale, so that is what I wound up purchasing.  It works quite well and is MUCH quieter than the Twin Frozr IV, even before the grinding noise started.
    For anyone else considering this, please be aware that the Xtreme III is monstrously huge (it adds several inches to the length of the MSI N670 PE).  Make sure you have plenty of room in your case for it.

  • My display has quit working.  Does anyone have a solution for this problem?

    I have had my Verizon Jetpack MiFi 5510L for a couple of months now.  It has worked fine until a few days ago the display on it started looking strange and now has finally gone blank.  Does anyone have a solution for the problem?

    You can do both, whatever is more convenient to you.  As long as VZW gets its hands on the old device you will be good to go.  Replacements under the warranrty require the user to turn in the old device to VZW.  If your old device is not returned then you will be charged a fee for an entirely new device.  Purchasing a tracking number for a shipment of this kind would be a good idea if you choose to send it in.  Otherwise dropping it off at a store is the safest route you can take. 
    I would suggest contacting VZW phone support on this one and running through your options.  The VZW phone rep can coordinate a delivery to your local VZW store if they do not already have one in stock.  You can also turn in the old device in person to rule out any non-returned device fees.

  • Anyone has a solution for the problem: typing keywords and suddenly it does not work anymore. Mostly I have to restart my iphone 4Gs

    Does anyone has a solution for this problem?
    Since I updated to iOS 6 sometimes my keywords did not work.
    I always have to restart my iPhone to have it work.
    It's ridiculous to always restart my phone.
    If you also have this problem you can repost + give some tips.
    Thanks and greetings,
    Max Louis

    Hi Alo816,
    I'm sorry to hear you are having such extensive issues with Messages on your iPhone. If you continue having issues sending or receiving Messages, you may find the troubleshooting steps outlined in the following article helpful:
    iOS: Troubleshooting Messages - Apple Support
    If you continue to have issues with Messages after that troubleshooting, especially if it is still having or crashing, you may want to make sure you have a current backup of your data in iTunes, then try restoring your iPhone to factory settings and testing it in that default condition to see if the issues persist before restoring your data. You may find this article useful:
    Use iTunes to restore your iOS device to factory settings - Apple Support
    Regards,
    - Brenden

  • For last one month I am facing problem in watching online videos on my iPod touch. It is opening or can say loading the online videos. Earlier it used to be work absolutely fine. Any solution for my problem.

    For last one month I am facing problem in watching online videos on my iPod touch. It is opening or can say loading the online videos. Earlier it used to be work absolutely fine. Any solution for my problem.

    For last one month I am facing problem in watching online videos on my iPod touch. It is not opening or can say loading the online videos. Earlier it used to be work absolutely fine. Any solution for my problem.

  • I am unable to send to an address that I have been using for a long time. All aspects have been investigated but with no solution ,has anyone encountered this problem before?

    I am unable to send to an address that I have been using for a long time. All aspects have been investigated but with no solution ,has anyone encountered this problem before?

    Hi Eric,
    The message seems to totally disappear. It is going to an AOL customer in UK. I changed their address to start with a lowercase letter & the message was returned to me by AOL as undeliverable, I then changed the first letter of the address beck to upper case, the same I have been using for years, but again it disappeared.
    I appreciate any help you can give me. Tks Gord.

  • Can anyone solve (or) give me a solution for this problem.....?

    Hi Everyone!
    Can anyone solve (or) give me a solution for this problem.....?
    We have used two folders Source & Finalwork. We have get image from Source folder and put silo path & Moved to Finalwork folder.
    Is this possible to check whether both folder images Embedded color profile same or not.
    -yajiv

    Could you elaborate what you mean by this
    We have get image from Source folder and put silo path & Moved to Finalwork folder.
    Possibly again with a screenshot to illustrate the task?
    // 2012, use it at your own risk;
    #target photoshop
    var theFolder = Folder.selectDialog ("select source folder");
    if (theFolder) {
    var theFiles = theFolder.getFiles(/\.(jpg|tif|eps|psd)$/i)
    var theOtherFolder = Folder.selectDialog ("select target folder");
    if (theOtherFolder) {
    var theOtherFiles = theOtherFolder.getFiles(/\.(jpg|tif|eps|psd)$/i)
    var missingFiles = new Array;
    var unmatchedProfiles = new Array;
    // work through files;
    for (var m = 0; m < theFiles.length; m++) {
              var check = false;
              var theFile = theFiles[m];
    // find name of the same name;
              for (var n = 0; n < theOtherFiles.length; n++) {
                        var theOtherFile = theOtherFiles[n];
    // if one is found;
                        if (theFile.name == theOtherFile.name) {
                                  check = true;
                                  var oneFile = app.open(File(theFile));
                                  var otherFile = app.open(File(theOtherFile));
    // check profiles;
                                  if (oneFile.colorProfileName == otherFile.colorProfileName) {
    // collect umages with unmatched profiles;
                                  else {unmatchedProfiles.push(theFile)};
    // collect missing files;
              if (check == false) {alert ("hahaha");missingFiles.push(theFile)}
    // alert of problems;
    if (unmatchedProfiles.length > 0) {
    alert ("the corresponding files for these do have a different color space:\n"+unmatchedProfiles.join("\n\n"));
    if (missingFiles.length > 0) {
    alert ("these files miss corresponding ones:\n"+missingFiles.join("\n\n"));
    ////// get psds, tifs and jpgs from files //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {
            return true

  • I have my Adobe ID and the Adobe Digital Editions. But when I download an EPUB-ebook, I don´t see the ebook or "My Digital Editions-Bibliothek".What is the solution for this problem?

    @I have my Adobe ID and the Adobe Digital Editions. But when I download an EPUB-ebook, I don´t see the ebook or "My Digital Editions-Bibliothek".What is the solution for this problem?

    how can we solve the problem?
    I have my adob.e ID, downloaded Adobe Digital Editions.
    Whren I download EPUB-ebooks and want to use
    Digital Editions, nothing happens and appears!??
    Please give me a short feedback and help

  • When I try to install PSE11, I keep getting error 1935, does anyone have a solution for this problem

    When I try to install PSE11, I keep getting error 1935, does anyone have a solution for
    this problem?

    This thread from the Premiere Elements forum may help:
    http://forums.adobe.com/thread/1286807?tstart=0

  • Hi! Did anyone happen that AppStore simply disappear? Anyone have a solution for this problem? Thanks!

    Hi!
    Did anyone happen that AppStore simply disappear?
    Have anyone a solution for this problem?
    thanks! bbj

    Hi.
    Do you mean that App Store has disappeared from the Dock? If so it'll still be in Applications. Select it in Applications, when it opens in the Dock move it one or more places, it will then stay there to access next time you want it.
    If you don't mean the above, see if you have accidentally moved the application to the Trash.
    Good luck,
    Adrian

Maybe you are looking for

  • Set a column to be nullable

    Hi, I am not really good at SQL. Please help me if you can. I have a column that's Nullable (yes), default (1). Now I want to set the default of the column to null and set the column to be nullable. Here is what I am doing: create table testit (foo n

  • Lightroom 5.4 crashes when attempting to print.

    I am working on a MacBook Pro running Maverick and currently printing to an Epson Artisan 50. Earlier in the spring, after a previous LR update, every time I tried to print the application crashed. It did not matter which printer I was using (I also

  • Cannot download coverted pdf to word file

    Signed up last evening for the product. Uploaded 2 documents for conversion from pdf to word. Conversion runs and indicates file is available for down load. Click on down load and get this error message.

  • Java platform se 7 u is vunerable iv tried updating still the same problem how do i fix this?

    when i try to use this add on i get that error message and tells me to update it after updating it the problem continues.

  • T61p XP3 with Mat**bleep**a UJ-852 will not read CDs

    Got From IBM Certified Used Equipment back in April, and just noticed I can't read CDs.  Read alot of problems with the UJ-852 and DVDs, but not the problem I'm (my wife) is having.  Machine Type 6457 AK7 with latest BIOS and Controller code.  I have