Hovering mouse over a button and painting

The following code is what I have to try to paint a rectangle when ever I hover over a button. This rectangle will show a brief description of what the button will do. I'm doing something similar when pressing the help button and hovering over something a description in a rectangle shows up. But I cannot get the paint method to work. Can anyone tell me what I need to do to fix this.
public void mouseMoved(MouseEvent e) {
                    //System.out.println("asdf");
                    showMessage("Test");
               private void showMessage(String string)
                    public void paint(Graphics g)
                         g.fillRect(25, 20, 20, 20);
                         g.drawString("Hello", 25, 20);
                    //System.out.println(string);
               }

jadescor wrote:
The following code is what I have to try to paint a rectangle when ever I hover over a button. This rectangle will show a brief description of what the button will do. I'm doing something similar when pressing the help button and hovering over something a description in a rectangle shows up. But I cannot get the paint method to work. Can anyone tell me what I need to do to fix this. You really need to read the Sun Java Graphics tutorial as your assumptions on how painting works is not correct. For instance, you shouldn't be calling the paint method directly.
Also, do you want to be doing this Graphics? Would it be easier to just add a tool tip to your button (i.e., use setToolTipText(...))?
Good luck.
Edited by: Encephalopathic on Apr 19, 2008 8:20 PM

Similar Messages

  • Problem w Plug-in Check page: the "Update" button for my outdated version of the WMP plugin does not do anything, and no link is indicated in the status bar when I mouse over the button.

    In Firefox, I select Tools > Add-ons > Find Updates. The Plugin Check page comes up in the browser. The entry for the WMP Plugin indicates it is out of date. I click on the "Update" button and nothing happens. When I mouse over the button, no link is indicated in the status bar (it continues to read "Done").
    The entries for the other plugins indicate they are current. When I mouse over the "Up to date" button for each of those entries, a link is indicated in the status bar.
    I am running Windows XP SP2 on a 2005 Dell Inspiron 6000 (1.6 GHz Pentium M processor, 590 MHz bus, 504 MB RAM). I have Norton Internet Security 2010 installed and running.

    See:
    * http://kb.mozillazine.org/Windows_Media_Player#Missing_plugin
    * http://windows.microsoft.com/en-US/windows/downloads/windows-media-player (see Firefox)
    * http://port25.technet.com/pages/windows-media-player-firefox-plugin-download.aspx

  • Specific region mouse over effect(Button 1 fades out and Button 2 fades in).

    Dear All -
    I am new to Flash CS5 and building Flash navigation bar with buttons on it.
    Below is my problem description that I want to solve with your help.
    I have a rectangular bar and placed one small button(Button 1) on this bar. Also, I have similar button(Button 2) with some graphics on it which is of similar size as to previous Button 1.
    Button 1 - Without graphic.
    Button 2 - With graphic on it.
    What I want is that, whenever mouse is taken over Button 1 placed on the rectangular bar, it should fade out and simultaneously Button 2 should fade in. I want only button region to be sensitive to this mouse over effect and not the complete rectangular bar.
    Kindly let me know how can I define the specific region(button region only) to be sensitive to mouse over effect in flash, and how to place Button 1 and Button 2 in layers so that both are at the same positition(so that there is no displacement of button detected).
    Thank You,
    Saurabh Khanna.

    Hello -
    Thank you for the reply. Button 1 does not have glowing effect, whereas Button 2 has a glowing effect. So what I wanted is that when initially Button 1 is loaded during page load, when I mouse over Button 1, Button 1 would fade out and Button 2 sitting behind Button 1 would automatically look like fade in(due to gradual fad out of Button 1 on top of Button 2).
    I could do this now, and would like to Thank you for your reply.
    I did this by creating movie clip on "Over" event of Button 1 and changing its Alpha property. But now what I want is how to gradually fade out, means when I remove my mouse from over button, then Button 2 should fade out gradually which will automatically make Button 1 fade in gradually.
    I could not find the "Out" event just like we have "Over" event for Button, so I assume this can only be done using ActionScript somehow.
    Let me know if I am going correct with my assumption, and possibly if you could help me achieve the remaining half(fading out gradually when mouse is removed from the button).
    Thank You once again for your reply.
    Thank You,
    Saurabh Khanna.

  • How to see document file name with full path when hovering mouse over title bar?

    Using PS CS6, Windows 7 x64.
    I was under the impression that when hovering my mouse over the document title bar, I would see a tooltip showing the full file name, including the path.  This isn't happening and I'm wondering if there is a way to do this.  I know I can click File > Save As, or Ctrl+Shift-S to see the full path, but hoving over the title bar would be easier.  (What I am seeing now in the tooltip is the file name, % magnification and which layer I have selected.  Basically, the tooltip is just showing what's in the title bar without hovering.)
    Thank you!
    John

    Hm, I wonder if it's something they may have enabled only for the Cloud version (I have 13.1.2).  If so, I didn't notice the change at the time of the upgrade.
    Nope, it's not that - I have a virtual machine for testing with 13.0.1 installed...  This is what I see there:
    -Noel

  • Hovering mouse over messages

    Just got switched from BT Yahoo mail to BT mail. Found that hovering the mouse over in-box messages does not reveal email addresses, so I can't identify potentially unwanted/dangerous messages like I used to do. Any suggestions please? 

    What info, apart from the one I provided, should I post? I don't even receive any message at all when X crashes and nothing responds and I have to manually shutdown.

  • How can I add popup help messages when I mouse over a button

    Hi there,
    I haev Acrobat x 10 pro.
    I'm new to acrobat and would like to set up a friendly form for people to fill in online.  I'd like them to have some interactive help so that for example when they mouse over or click a button, some help text appears.  I've played around with adding a text field that is hidden and then adding action items to a button to show it.  This works, but my text field is shaded like a normal text field and I'd like it to look different.
    Is there a better way to to this popup effect or is there a way t omake the popup look like a popup and not a text field?
    All help gratefully received,
    Thanks in advance.

    I'mnot sure what you mean by shading exactly, but you can set up a text field so that it doesn't have an inset border. An alternative is to use a button to display the text. Buttons are more flexible since you can set a button icon to be anything that can appear on a PDF page (text, images, vector graphics). For a sample, see: https://acrobat.com/#d=aP-2xL45pM57xVkT6d6fSg
    Also, if you use a text field, set it's default value to the text you want to display so that the field won't get blanked if the form is reset. You don't have to worry about this when using buttons.

  • Help turning off info-box pane when hovering mouse over photo

    I am looking to turn-off this info pane, it appears when I have my mouse over a photo in any preview. It is really distracting and I cannot locate the menu to switch it off... any help is much appreciated!
    Screenshot found here: vhttp://img545.imageshack.us/img545/1622/screenshot20101116at101.png

    Thank you so much, very embarrassing

  • Multiplu button after mouse over one button

    Hi, can anyone teach me how to do this is Flash Catalyst: when pointing on "Products" button, a slider scroll down with lots of buttons. how can i create these buttons upon mouse-over the "product" button. thanks heres the link.     http://www.ozdesignfurniture.com.au/media/nav/Menu.swf

    OK, I've upload to internet...
    example
    I think it's a problem of indesgin, when it create pdf.
    When I create the animation in acrobat, there's no problem...

  • Outlook 2013 calendar shows 24 hour time when hovering mouse over appointment

    Strange thing is, the computer is not set that way and the calendar's appointments show 12 hour time except when I hover the mouse over the appt. This is Outlook 2013 with Exchange/ Office 365.

    Hi,
    Please start Outlook in safe mode to check whether the issue persists. If the issue doesn't happen in safe mode, it may be caused by some third-party add-ins. We can enable the add-ins which is disabled in safe mode one by one to find out the main cause.
    For more information, please refer to Step 6: Start Outlook in safe mode
    in the following KB to check whether the issue is caused by the temporary changes that occur when you start Outlook in safe mode:
    http://support.microsoft.com/kb/2934538/en-gb
    Regards,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Winnie Liang
    TechNet Community Support

  • Can I mouse over a group and cause another group to do something?

    When I mouse over id=wholeGroup, I want group rect47 to become more visible by changing its alpha value.
    Can someone help me understand how to do this? Thanks.
    Here is what I have so far, but I am getting multiple errors.
    1067: Implicit coercion of a value of type String to an unrelated type Number.
    1119: Access of possibly undefined property mouseOver through a reference with static type spark.components:Group.
    <fx:Script>
      <![CDATA[
         private function showYourSelf():void {
              if (wholeGroup.mouseOver==true) {
                   rect47.alpha="1.0";
               } else {rect47.alpha="0.3";}
      ]]>
    </fx:Script>
    <s:Group id="wholeGroup" mouseOver="showYourSelf()" >
      <s:Group id="rect47">
          <s:Rect>
             <s:fill>
                  <s:SolidColor color="0x474747"/>
              </s:fill>
         </s:Rect>
      </s:Group>
      <s:Group id="rect87">
         <s:Rect>
             <s:fill>
                  <s:SolidColor color="0x878787"/>
              </s:fill>
         </s:Rect>
      </s:Group>
    </s:Group>

    Change the strings to numbers:
    rect47.alpha=1.0;
    <s:Group id="wholeGroup" mouseOver="showYourSelf()" mouseOut="hideYourSelf()">
    In the function showYourSelf() just set rect47.alpha=1.0
    In the function hideYourSelf() set rect47.alpha=0.3
    No need for the if statement.

  • How to turn off image info when hovering mouse over image?

    I think I must have selected something by accident because now everytime I hover my mouse over an image, I get all this info about that image. I know it can be info will be good to know but I don't want to see it all the time. I can't find anything in the settings that seems like it would be able turn it off.
    suggestions?

    ress the T key on your keyboard

  • When I go to a drop down menu, for example bookmarks, I mouse over the text and it turns color with a dark bar; can this be fixed?

    I am running Firefox 5 currently. Ever since the last update to Firefox 4 and currently with firefox 5 I have had this issue. The dropdown menu is normal when it first drops down. When i move my cursor over the text in the menu it changes to a dark blue bar and remains that way until I close the dropdown, it resets until i dropdown and mouseover again. When I make a selection in the menu it works fine.
    I have also noticed that the buttons in the browser and in certain websites have a "sweetspot" you have to hit for the button to function. In past versions if you clicked anywhere on the graphical button it would function.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    In Firefox 4 [http://kb.mozillazine.org/Safe_mode Safe mode] disables extensions and disables hardware acceleration.
    * Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    If disabling hardware acceleration works then check if there is an update available for your graphics display driver.

  • Get rid of predictive urls while hovering mouse over link in firefox 6

    I hate movement on my desktop as it is distracting. If something moves, it should need my attention. While hovering my cursor over URLs, I now see the URL in the lower left, and I can't stop that from showing.
    I don't need to proofread URLs, so there is NO reason to have that on my computer, it's highly distracting.
    How do I stop it? I've played with about:config for a while, but it seems there is no clear option to toggle off.
    I realize the status bar is gone, great, but again, there is no reason for me to proofread my URLs that I'm hovering over, so please, tell how to stop this distraction, thank you.

    hello evilelf, you have various malicious addons present. please try to [[Reset Firefox – easily fix most problems|reset firefox]] (this will keep your bookmarks and passwords).
    [[Troubleshoot Firefox issues caused by malware]]

  • Create a "mouse over" interactive button in html5 canvas

    Hi there,
    I’m currently using the HTML5 canvas in flash Professional CC.
    I want to create an animated button that grows when you hover over it and then shrinks when you hover off it.
    I can do this in AS3 but I can’t seem to do it in the HTML5 canvas.
    I’ve placed the animated button in a movieclip and stopped it at the start of the movieclip timeline then added this code to try and activate it when I hover over it but it didn’t work:
    this.movieClip_2.addEventListener(“mouseover, fl_mouseoverToGoToAndPlayFromFrame_3.bind(this));
    function fl_mouseoverToGoToAndPlayFromFrame_3()
        this.gotoAndPlay(2);
    I've also tried to create a standard "button symbol" then added the animation within each action (Up, Over, Down). This didn't work either.
    Any help would be much appreciated!
    Matt

    this.movieClip_2.addEventListener(“mouseover, fl_mouseoverToGoToAndPlayFromFrame_3.bind(this));
    function fl_mouseoverToGoToAndPlayFromFrame_3()
        this.gotoAndPlay(2);
    should be:
    this.movieClip_2.addEventListener(“mouseover", fl_mouseoverToGoToAndPlayFromFrame_3.bind(this));
    function fl_mouseoverToGoToAndPlayFromFrame_3()
        this.gotoAndPlay(2);

  • Mouse (mighty) right button and finder ...causing finder to restart

    Very annoying, since the latest updates using the right button of my wireless might mouse cause OFTEN a finder restart.
    Not always but quite often (i will say 50% of the time i use it). I'm sure there is a bug in the code. Please....check it.
    thanks
    .oesse.
    Dual G5 2Ghz   Mac OS X (10.4.8)   4 Gb RAM

    oesse,
    Can you identify any corrupted or incompatible third party files in the following folders:
    Macintosh HD/System/Library/Contextual Menu Items
    Macintosh HD/Library/Contextual Menu Items
    Macintosh HD/Users/yourusername/Library/Contextual Menu Items
    If so, you may be able to uninstall/reinstall the associated application.
    You may also consider temporary sequential manual removal and isolation of the suspect file to verify CM functionality.
    StuffitCM.plugin seems to have a reputation for crashing Finder.
    SmithMicro Support says: There appears to be a bug in the version of the contextual menu plug-in that was installed with Stuffit Deluxe 11.0.2. Luckily, our development team was able to devise a patch quickly, and it is available here...
    ;~)

Maybe you are looking for

  • Transferring catalogues from Photoshop Elements 5 to Photoshop Elements 9

    The process should be an easy one -- BUT, my new copy of Elements 9 does not list under the FILE column, anything that looks like or works like "Catalogue". Instead of the listing as per the Adobe tutorial as follows: FILE (then) Get Photos & Videos,

  • Using the command line with DESKI to run a specific module in a report

    I'm using BOXI R2 Desktop edition in a Windows Environment. I have a report with a macro inserted in it which is composed of several sub-modules.  I know I can launch the report from the command line as follows: "C:\PROGRAM FILES\BUSINESS OBJECTS\BUS

  • Questions about Classical Layout Formatting

    Hi, Just a question on classic reporting. Im pretty sure we can customize the layout of a classic report to look like this, ie. SDN    SAP      &nbsp:NETWORK Therefore, when a user print this report out, will the report come out this way? When the us

  • Where is the api documentation?

    Um, I signed up for my key and cannot find the api docs anywhere. Would someone please provide a link to the api documentation? Thank you.

  • Can we create ACL any where?

    Hi, as a part of my DB migration, i was asked to create the ACLS in the target DB and i am completely new to ACLS. Can any body guide me following points. 1) can i create ACLS in any location. for eg. in my source database. ACL related file is locate