How to underline the text when the mouse is over the text

I want to underline text when I move a mouse over it? Is this possible with JavaFX event listener?

Create some text, set style-class and add it to the scene.
Text text = new Text("Hello World!");
text.getStyleClass().add("text");
In a stylesheet (e.g., my_styles.css file)
.text:hover { -fx-underline: true; }
Add the stylesheet to the scene:
scene.getStylesheets().add("my_styles.css");
Or, add a listener to the hoverProperty.
        text.hoverProperty().addListener(new ChangeListener<Boolean>() {
            @Override
            public void changed(ObservableValue<? extends Boolean> observableValue, Boolean oldVal, Boolean newVal) {
                    text.setUnderline(newVal);
Or bind the underlineProperty to the hoverProperty
    text.underlineProperty().bind(text.hoverProperty());

Similar Messages

  • How to stop button flicker when you mouse over?

    http://happynick.com/sheflash/main246.html
    After the intro video,
    When you mouse over "the films" button, it flickers once.
    why?
    When when mouse over "the company" and "contact" buttons, it
    does not.

    Sorry, my 20-20 eyes are missing it. Maybe my iMac is rendering things quicker than your laptop.

  • I am using pdf.js to render pdf document. How to detect when a mouse is over an image?

    Hi,
    i want to change the cursor pro grammatically whenever we move the pointer over an image on a pdf document rendered on the browser. I am using pdf.js to render the pdf document.
    I would like to know is there any api exists in pdf.js this will take the x and y coordinates and return whether any image was drawn on the specified x and y coordinates?
    Thanks
    Suresh K

    Add a mouse motion listener to the tree, and check the node at the mouse location.
    Then change the icon of the tree accordingly:
    tree.addMouseMotionListener(new MouseMotionAdapter() {
        public void mouseMoved(MouseEvent e) {
            JTree tree = (JTree) e.getComponent();
            TreePath path = tree.getClosestPathForLocation(e.getX(), e.getY());
            Rectangle bounds = tree.getPathBounds(path);
            if (!bounds.contains(e.getPoint()))
                System.out.println("No tree node under mouse");
            else {
                TreeNode node = (TreeNode) path.getLastPathComponent();                   
                System.out.println("Tree node under mouse: "+node);
    });

  • How to repeat a row when tablix columns print over more than one page

    I have a tablix with 20 Columns.  When this prints it prints over 3 pages (which is
    OK).   The first Column is the Name (in this case it is the
    Project name).  On Page 2 & 3 I want to print the Project name again,
    so that a report user does not need to go back to page one to figure out which
    project the columns are referring two.  In Excel there is an option
    "Rows To Repeat".  I am trying to do the same in SSRS
    2012. 
    I have tried links
    like:
    http://msdn.microsoft.com/en-us/library/dd207045.aspx
    http://remicaron.wordpress.com/2010/01/05/how-to-get-ssrs-to-repeat-the-row-headers-tablix-2008/
    http://www.sqlcircuit.com/2012/03/ssrs-how-to-repeat-column-header-in.html
    These do not work
    for me .... in fact they return an error msg
    Can this be done?
    Tx
    Andrew
    Andrew Payze

    Hi Andrew,
    If I understand correctly, there are 20 columns in the table. When it prints over 3 pages, the report should repeat the first column in all pages.
    To freeze row header in the table, we can refer to the following steps:
    The table should have a group. If the Name is already a row group, we can directly refer to step 2. Or we need add a row group grouped by Name ahead.
    Right-click the table to open the Tablix Properties dialog box, then enable “Repeat header rows on each page” and “Keep header visible while scrolling” options under Row Headers category.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Display the name of a button when mouse moves over it

    when a mouse moves over a button i want the name of the label to be displayed at the tip of the mouse...like we have in microsoft word and other applications...how do i do that??

    Its called a Tooltip. Now that you knoow that, search the API for a suitable method to invoke to set the Tooltip text.
    luck, db

  • PLEASE HELP I am using an alienware m11x and the only problem i have is when i go to the bar on firefox 4 like the file,edit,etcc what every my mouse hovers over turns black and stays black :/

    When my mouse hovers over the bar on firefox 4 it turns black so if i hover all of them all of them turn black and stay black and i cant see anything. Also I am using an alienware m11x with a dual core duo 2 Su700 (@1.3) (@1.3) with a 1g nvadia graphics card 335m geforce.

    Make sure that you allow pages to choose their colors and that you haven't enabled High Contrast in the Accessibility settings.
    *Firefox > Preferences > Content : Fonts & Colors > Colors : [X] "Allow pages to choose their own colors, instead of my selections above"
    See also:
    *http://kb.mozillazine.org/Images_or_animations_do_not_load
    *https://support.mozilla.org/kb/Images+or+animations+do+not+show

  • HELP! Continuous Object Motion When Mouse Moves Over - ActionScript 3.

    Hello! I'm working on a school project. Below is an image of what I am working on.
    My cursor in this movie is the heart. When I move my mouse over Hello Kitty she jumps -- but only once. How can I get her to keep jumping when my mouse is over her, and make her stop jumping when I pull away? Here is the code below. If you can help that would be great!!!
    Also, because I am new to ActionScript I might have messed up with the motion of the animation. Hello Kitty used to jump continuously without me doing anything. Then I copied the motion code into my ACTIONS layer and put stop(); in the Hello Kitty object code. So, she doesn't jump all the time anymore, just when my mouse moves over her... but she only jumps once and that is the problem. I want her to keep jumping as long as my mouse is over her. Please HELP! THANKS!!!!
    import fl.motion.Animator; // I COPIED THIS MOTION FROM THE TWEEN MOTION ON THE KITTY
    var kittyMotion_xml:XML = <Motion duration="15" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
    <source>
    <Source frameRate="24" x="8.95" y="63.9" scaleX="1" scaleY="1" rotation="0" elementType="graphic" symbolName="Tween 1">
    <dimensions>
    <geom:Rectangle left="-110.65" top="-135" width="221.35" height="270.05"/>
    </dimensions>
    <transformationPoint>
    <geom:Point x="0.49988705669753786" y="0.49990742455100906"/>
    </transformationPoint>
    </Source>
    </source>
    <Keyframe index="0" tweenSnap="true" tweenSync="true">
    <tweens>
    <SimpleEase ease="0"/>
    </tweens>
    </Keyframe>
    <Keyframe index="14" tweenSnap="true" tweenSync="true" firstFrame="14" y="-63.55">
    <tweens>
    <SimpleEase ease="0"/>
    </tweens>
    </Keyframe>
    </Motion>;
    /*var kittyMotion_animator:Animator = new Animator(kittyMotion_xml, kittyMotion);
    kittyMotion_animator.play();*/
    HKITTY_mc.addEventListener(MouseEvent.MOUSE_MOVE, mouseMOVE); // MOVE MOUSE TO MAKE KITTY JUMP
    function mouseMOVE(event:MouseEvent):void {
    HKITTY_mc.gotoAndPlay(kittyMotion_xml.currentFrame);

    I won't be around much longer today, so on just a hunch I'd say if you comment out all of what you showed in your first posting, use what's below, and get rid of anything that might be stopping the kitty from jumping, it might work... though it might not...
    HKITTY_mc.gotoAndStop(1);
    HKITTY_mc.addEventListener(MouseEvent.ROLL_OVER, kittyJump);
    function kittyJump(event:MouseEvent):void {
         HKITTY_mc.play();
    HKITTY_mc.addEventListener(MouseEvent.ROLL_OUT, kittyStop);
    function kittyStop(event:MouseEvent):void {
         HKITTY_mc.gotoAndStop(1);

  • Data point display when mouse hovers over data point in TCODE QGC1

    Hi experts,
    Just want to ask if anyone knows how to add more data in the display when your mouse hovers over the data point in the control chart of transaction QGC1?
    Because currently the control chart shows u201CSeriesu201D and u201CValueu201D, Iu2019m planning to add the inspection lot date when your mouse hovers over the data point.
    Hope to have some response regarding this and thanks in advance

    Tohatsu,
    I am not sure exactly what you are trying to do but the way you have went about doing things is not the way to code in LV. Fist off break your code into functional blocks and use these functional blocks as Subvi's. This will make your block diagram easier to read. Once you do this you can get rid of a lot of code. Also you need to learn how to use the event structure, right now the way your code is set up to use it is not correct. Have a look at the examples that ship with LV. i am not even going to begin to try to understand your code because the diagram is so large. Please do not take all of this the wrong way I am not trying to be hard on you or anything, I am just giving you some constructive criticism..
    Break your code down into functional blocks and use subvi's to perform those blocks of code.
    Have a look at the examples on how to use an event structure.
    Have a look at state machines
    You would also benefit from getting the book called Labview for everyone, third edition, jeffrey travis and james kring.
    You have a lot going on in this VI. Use the eventstucture to your advantage instead of as a hinderence like it is now. the way your code is set up now everything runs in your while loop, then it waits for an event to fire. in your case the while loop will not run again until the mouse moves over the waveform chart. You are on the right track, you just need to get some fundamental basics down and you will figure out what is going on.
    Thanks for converting the code to 8.0 for me.
    Message Edited by Jhoskins on 01-30-2008 09:17 AM
    Joe.
    "NOTHING IS EVER EASY"

  • GUI components only appear when mouse passes over them???

    I have a frame that contains componentes but they only appear when my mouse passes over them or clicks on them. can any one help with this. i do only set vibible after i have added them but the problem seems the same as if i haddent.

    Sorry i couldn't make a SSCCE because it doesnt happen with small programs. my code is pretty long but here it is if any one can help.
       import java.io.*;
       import javax.swing.*;
       import java.awt.*;
       import java.awt.event.*;
       import java.awt.image.*;
       import jmfdemo.*;
       import java.util.*;
        public class LaserControll extends Frame implements ActionListener
          //Setings
          int vk[]=new int[9];
          int samplePlus=100;
          boolean vis=true;
          int rePaint=1000;
          int time=250;
          int numP=5;
            //End of Settings
          private BufferedImage image1;
          private FrameGrabber vision1;
          private int threshold = 200;
          private Color on = Color.white;
          private Color off = Color.black;
          int x,y;
          Rectangle r1,r2,r3,r4,r5,r6,r7,r8,r9;
          boolean found=false;
           public void paint(Graphics g) {
             if (image1 != null)
                g.drawImage(image1, 10, 30, this);
           public void load()
             try{
                File f=new File("Data");
                Scanner sk=new Scanner(f);
                for (int y=0;y<9;y++)
                {sk.nextInt();
                   sk.nextInt();
                   sk.nextInt();               
                   sk.nextInt();
                   vk[y]=sk.nextInt();
                vis=sk.nextBoolean();
                samplePlus=sk.nextInt();
                rePaint=sk.nextInt();
                time=sk.nextInt();
                numP=sk.nextInt();}
                 catch(Exception q)
                {System.out.println(q+"");
                   JOptionPane.showMessageDialog(null,"Error: Data File Cannot be Found","Error",JOptionPane.ERROR_MESSAGE);
                   System.exit(0);
           public void update(Graphics g) {
             paint(g);
           public void getRects()throws IOException
          {File f=new File("Data");
             Scanner sc=new Scanner(f);
             int x,y,w,h;
             x=sc.nextInt();
             y=sc.nextInt();
             w=sc.nextInt();
             h=sc.nextInt();
             sc.nextInt();
             r1=new Rectangle(x,y,w,h);
             x=sc.nextInt();
             y=sc.nextInt();
             w=sc.nextInt();
             h=sc.nextInt();
             sc.nextInt();
             r2=new Rectangle(x,y,w,h);
             x=sc.nextInt();
             y=sc.nextInt();
             w=sc.nextInt();
             h=sc.nextInt();
             sc.nextInt();
             r3=new Rectangle(x,y,w,h);
             x=sc.nextInt();
             y=sc.nextInt();
             w=sc.nextInt();
             h=sc.nextInt();
             sc.nextInt();
             r4=new Rectangle(x,y,w,h);
             x=sc.nextInt();
             y=sc.nextInt();
             w=sc.nextInt();
             h=sc.nextInt();
             sc.nextInt();
             r5=new Rectangle(x,y,w,h);
             x=sc.nextInt();
             y=sc.nextInt();
             w=sc.nextInt();
             h=sc.nextInt();
             sc.nextInt();
             r6=new Rectangle(x,y,w,h);
             x=sc.nextInt();
             y=sc.nextInt();
             w=sc.nextInt();
             h=sc.nextInt();
             sc.nextInt();
             r7=new Rectangle(x,y,w,h);
             x=sc.nextInt();
             y=sc.nextInt();
             w=sc.nextInt();
             h=sc.nextInt();
             sc.nextInt();
             r8=new Rectangle(x,y,w,h);
             x=sc.nextInt();
             y=sc.nextInt();
             w=sc.nextInt();
             h=sc.nextInt();
             sc.nextInt();
             r9=new Rectangle(x,y,w,h);
           public int sample()
          {int sample=image1.getRGB(x/2,y/2);
             int sr,sg,sb;
             Color sc=new Color(sample);
             sr=sc.getRed();
             sb=sc.getBlue();
             sg=sc.getGreen();
             sample=((299 * sr + 587 * sg + 114 * sb) / 1000);
             return sample;
           class WindowListener extends WindowAdapter {
              public void windowClosing(WindowEvent e) {
                System.exit(0);
           public LaserControll()throws Exception {
             Robot r =new Robot();
             load();
             addWindowListener(new WindowListener());
             setTitle("Laser Control");
             try {
                vision1 = new FrameGrabber();
                vision1.start();
                 catch(FrameGrabberException fge) {
                   System.out.println(fge.getMessage());
             image1 = vision1.getBufferedImage();
             setResizable(false);
             Color col = new Color(229,229,229);
             setBackground(col);
             x=image1.getWidth()-1;
             y=image1.getHeight()-1;
             for (int i=0;i<5000;i++)
                image1 = vision1.getBufferedImage();
                repaint();
             int sample=sample();       
             try{
                getRects();}
                 catch(Exception z)
             JButton hide=new JButton("Hide");
             hide.setBounds(35,183,100,20);
             hide.addActionListener(
                    new ActionListener() {
                       public void actionPerformed(ActionEvent e)
                         setAlwaysOnTop(true);
             JButton rc=new JButton("Recalibrate");
             rc.setBounds(35,160,100,20);
             rc.addActionListener(
                    new ActionListener() {
                       public void actionPerformed(ActionEvent e)
                      {int sam=sample();
                         JOptionPane.showMessageDialog(null,"New Threshold set to: "+sam+samplePlus,"Recalibrated",JOptionPane.INFORMATION_MESSAGE);
             JTextField status= new JTextField("");
             status.setBounds(146,184,20,19);
             status.setEditable(false);
             setLayout(null);
             add(status);
             add(hide);
             add(rc);
             setSize(image1.getWidth(this) + 20, image1.getHeight(this) + 95);
             setVisible(vis);     
          repaint();
             while(true) {
                image1 = vision1.getBufferedImage();
                repaint();
                try {
                   Thread.sleep(1);
                    catch(Exception e) {
                      System.out.println("Error");
                for (int i=0;i<x;i=i+numP)
                   for (int j=0;j<y;j=j+numP)
                      int v=image1.getRGB(i,j);
                      Color c =new Color(v);
                      int red=c.getRed();
                      int green=c.getGreen();
                      int blue=c.getBlue();
                      int b=(299 * red + 587 * green + 114 * blue) / 1000;
                      if (b>sample+samplePlus)
                         if (r1.contains(i,j))
                            r.keyPress(vk[0]);
                            r.keyRelease(vk[0]);
                            status.setText("1");
                            found=true;}
                         if (r2.contains(i,j))
                            r.keyPress(vk[1]);
                            r.keyRelease(vk[1]);
                            status.setText("2");
                            found=true;}
                         if (r3.contains(i,j))
                         { r.keyPress(vk[2]);
                            r.keyRelease(vk[2]);
                            status.setText("3");
                            found=true;}
                         if (r4.contains(i,j))
                         { r.keyPress(vk[3]);
                            r.keyRelease(vk[3]);
                            status.setText("4");
                            found=true;}
                         if (r5.contains(i,j))
                         { r.keyPress(vk[4]);
                            r.keyRelease(vk[4]);
                            status.setText("5");
                            found=true;}
                         if (r6.contains(i,j))
                         { r.keyPress(vk[5]);
                            r.keyRelease(vk[5]);
                            status.setText("6");
                            found=true;}
                         if (r7.contains(i,j))
                         { r.keyPress(vk[6]);
                            r.keyRelease(vk[6]);
                            status.setText("7");
                            found=true;}
                         if (r8.contains(i,j))
                         { r.keyPress(vk[7]);
                            r.keyRelease(vk[7]);
                            status.setText("8");
                            found=true;}
                         if (r9.contains(i,j))
                         { r.keyPress(vk[8]);
                            r.keyRelease(vk[8]);
                            status.setText("9");
                            found=true;}
                         if (found==true)
                            try
                               Thread.sleep(time);
                                catch(Exception e)
                                  System.out.println("Error!");
                            sample=sample();
                            for (int z=0;z<rePaint;z++)
                               image1 = vision1.getBufferedImage();
                               repaint();
                            found=false;
               setVisible(vis);
           public void actionPerformed (ActionEvent e)
           public static void main(String[] args)throws Exception {
             LaserControll a=new LaserControll();
       }

  • I recently bought, from the original website of Adobe, Photoshop elements 13. However, when I go with my mouse pointer over the menu, It hangs or he works very slow. Does anyone have an idea how I can fix it? I have already downloaded updates, both from A

    I recently bought, from the original website of Adobe, Photoshop elements 13. However, when I go with my mouse pointer over the menu, It hangs or he works very slow. Does anyone have an idea how I can fix it? I have already downloaded updates, both from Adobe and Windows. I have a new pc with window 8.1.

    It could be a coincidence, but I rebooted the machine and (knock on wood) PSE13 seems to be working ok.

  • I accidentally quit my CC on my Macbook pro and now the cloud icon is grayed out and every time I hover over it with the mouse I get the spinning beach ball of death on the icon. I have no idea how to open it because when I use spotlight search to open it

    I accidentally quit my CC on my Macbook pro and now the cloud icon is grayed out and every time I hover over it with the mouse I get the spinning beach ball of death on the icon. I have no idea how to open it because when I use spotlight search to open it it gives me a message saying "Creative Cloud is not open anymore" help!

    Since you didn't include any pertinent info such as the Mac model and OS version you are running, here is some general information:
    Mac OS X: Gray screen appears during startup
    Depending on which OS yours came with originally - and which OS you are now running - you would either need your original install disks - you can call Apple for replacements by giving them your serial number. Or you may be able to reinstall the OS by using recovery (again, depends on which model/which OS).

  • How to change the color of text but only when that text is highlighted

    I am NOT asking how to change the highlight color OR how to change the text color generally, but rather, how to change the text color as it shows onscreen while it is highlighted. Here's where I'm going:
    Text is ordinarily black (assume) such as when the Finder is open or when viewing a list of all emails in an inbox.
    Let's say I change the highlight color systemwide, in prefs > appearance > highlight color, to a custom color ("other") of black (for example).
    In certain programs (mail, billings, iBank, addressbook, even the Finder), when I highlight a line of something, (like when I one-click on an email or a file name just to select it but not open it), the line will highlight in black, but the text of that line will automatically change to white so it can be seen.
    However, when I highlight actual text (click and drag or double click), such as when editing a document in Pages and selecting a word, line, paragraph, editing an email, etc., the highlight is black, and the text remains black also, which means it cannot be seen (black on black).
    So, how do I change it so that when I highlight the actual text the text color changes to white, then when it is de-selected, it goes back to black.
    I'm not afraid to do a little terminal/command line, but only if it’s a little. Hope this gives enough detail.
    Thanks.

    You can use span HTML tag.
    For example, if your label is "Product Name", and you want it to appear in red, you can type this:
    <span style="color:red">Product Name</span>Hope it helps.
    Ravi

  • How to change the HTTP Response as XML (Content Type "text\xml")  When Post

    Hi Friends ,
    I have created one RFC Destination TYPE H . When i am trying to post some XML Message to that particular HTTP Service using POST method . It succesfully accepted the XML File but , it is returning the String as " OK" . In the connection test trace i have seen the Content Type as "text/html" but * I need to get as XML format no Srting    ( Type "text\xml" . ) *
    I need to get response back as XML not plain text .
    1 Any Configuration setting do we need to do on Service (SICF ) ?
    2. Or any other place we need to modify to get the HTTP Response as XML not plain text
    Can you please help to solve the problem . Any clue ?
    Thanks & Regards.,
    V.Rangarajan

    Dear users,
    we have requirement sending SMS to the customers mobiles. I am successfully sending the messages to the customers mobiles by using the above method. Facing issues with response message. The response messages is in plain text fromat in single line like...Sent
    Using HTTP_AAE Receiver adapter.
    The response message was failed while excution of the message mapping with the error
    Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_SMS_CUST_RES_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog.
    please share the comments how to pass the Status of the message to SAP ECC from SAP HTTP adapter
    Regards,
    Sudir.

  • AIR window mode bug? How to use the mouse when transparent?

    Hey there,
    I'm trying to build a transparent desktop application in AIR and have set the window mode to transparent.
    The mouseposition and mouseevents only work when the mouse hovers over a visible movieclip but not on the background.
    How can I fix that? Or is it an bug like some people say?
    Also in fullscreen mode the stage is a LOT bigger than the actual screen.. i already set:
    stage.scaleMode= StageScaleMode.EXACT_FIT;
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    but it doesn't help at all.
    thanks for helping

    Are you attaching your mouse handlers to the stage? If not, try it -- that's the typical way to capture mouse events within the entire flash player window. I'm not 100% it works with a NativeWindow set to transparent, though, since the main purpose of transparent window background is to simulate a non-rectangle window. If you want to have a transparent background but still act like a rectangular window you can probably just add a transparent rectangle (alpha=0, visible=true) to capture mouse events.
    Hope that helps.
    -Aaron

  • When and How to get the Text.ScrollPos value of a String control when scroll bar position changed

    Hi, 
    I'm working on a feature triggered by scroll bar position of a string control changed.
    But I could not find a good way to catch the scroll bar position changed event, 
    the scroll bar is controlled manually by mouse down → mouse move → mouse up, I want the get the Text.ScrollPos value when user mouse up, and compare with the maximum value.
    But the problem is,  mouse up on the scroll bar could not trigger String: Mouse up event!
    So I have to get the Text.ScrollPos continuously in the background in Timeout event, but I think it’s not efficient.
    Do you have any better idea on when to get the correct destination value of Text.ScrollPos?
    I plan to store the value of Text.ScrollPos in the bottom(maximum value) in a shift register, then compare the current Text.ScrollPos value with the max one.
    If it comes close to the bottom(90%~100% of the maximum value), then the close to bottom LED will turn on.
    Attachments:
    scroll bar pos changed.vi ‏15 KB

    Hello Cecilia,
    I don't think there is any build-in event for this.
    One solution would be to create your own user event at the initialisation of you main and launch a thread which is going to be pulling the value of your scrollbar position:
    Then you can build your main as if they were a scrollbar move event.
    And dont forget to close the thread and destroy the event at the end.
    Hope it helps.
    Attachments:
    Scrollbar event.PNG ‏10 KB

Maybe you are looking for