Javafx: How change color of focus of controls?

Hi everyone,
I got a trouble with change the color of focus of controls? Have anyone know? Please tell me. Here is my example.
[http://imageshack.us/photo/my-images/864/fffd.png/]
Please help me out. Thank very much.
Edited by: 904388 on Dec 25, 2011 7:45 AM

Hi,
The desired functionality can be acheived by customising the css of the text field. (or any control)
Suppose if the textfield/button declaration is like this.,
TextField text = new TextField();
Button btn = new Button();It's related focus css is as follows (in caspian.css file)
.text-field:focused {
    -fx-background-color: -fx-focus-color, -fx-text-box-border, -fx-control-inner-background;
    -fx-background-insets: -0.4, 1, 2;
    -fx-background-radius: 3.4, 2, 2;
.button:focused {
    -fx-color: -fx-focused-base;
    -fx-background-color: -fx-focus-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
    -fx-background-insets: -1.4, 0, 1, 2;
    -fx-background-radius:  6.4, 5, 4, 3;
}To customize the focus color, you need to define a custom class for your controls, like
TextField text = new TextField();
text.setStyleClass().add("myText");
Button btn = new Button();
btn.setStyleClass().add("myButton");and need to add the css accordingly for your focus color.
.myText:focused {
    -fx-background-color: #E99725, -fx-text-box-border, -fx-control-inner-background;
.button:focused {
    -fx-background-color: #E99725, -fx-outer-border, -fx-inner-border, -fx-body-color;
}I hope the above explanation will help you.
Happy Coding !! :)
Regards,
Sai Pradeep Dandem.
Edited by: Sai Pradeep Dandem on Dec 26, 2011 8:58 PM

Similar Messages

  • How to change colors of LCD/VFD controls from SGC-Tek?

    Hi Anybody got idea how to change colors of LCD/VFD controls from SGC-Tek?
    I have tried but could not. When I try to make myself a nest cluster of clusters of LEDs, I can change colours but I can't do the same thing with LCD/VFD controls.
    Please check at LCD/VFD controls
    Clement

    I suspect this repsonse is somewhat mis-leading, the code has no effect on the control other than setting its state, although the route is somewhat tedious for the mod.
    I would imagine that the control is set up so that the pixels didn't move around when they are being used as controls.
    There are nested groups and locks on the controls, which might make the ordering in the cluster easier to manage.
    The following should work....... ;-) it did for me
    Open  your own new VI
    Open the main LCD VI
    Open the Browse VI Hierachy
    Drag and drop the LCD VI onto your own diagram
    Create a cluster from the LCD VI's connector
    Now ungroup the clusters and unlock them (this is tedious) if you create your own then you could be more imaginative in the structure, I leave that for homework.
    Then import a new bitmap (gif) into the control
    Now update the modified contol back into the master control
    ........ Told you it could be done, but I am not sure the pain was worth it.
    BUT
    Try the alternative control..... with colour settings as well, ANY colour and even some size control.
    It was here http://members.lycos.co.uk/sgctek/

  • How change color on form SAP 7.5

    How change color on the form when the form load (Form Partners or Invoice form). I can use SDK UI-API programing interface.
    OR
    how change color cell on matrix (matrix chose PH)

    You can use something like this as the custom validation script of the
    drop-down:
    if (event.value=="Customer A") event.target.textColor = color.red;
    else event.target.textColor = color.black;
    Make sure you tick the option to commit the selected value immediately
    (under Properties - Options), so that it will change as soon as a selection
    is made.

  • S:TextArea How change color for some chars in text?

    I have s:TextArea and i need in runtime change color for some chars displayed in text.
    How i must to do this correctly?

    pcardinale wrote:
    Initially, a control has no caption.  It's not just that the caption string is empty and the caption not visible, but the caption object does not exist.
    I think this should probably be changed in future versions, because even if each control had a caption, it would still be a negligible small part of the VI. The current behavior made sense many years ago where HD and memory space was very precious. Not any more!
    This issue comes up often enough that it warrants addressing the root of the problem.
    It is hard to convince the casual that the caption does not exist if he can simply do a "show caption" at edit time and it will show in all glory, even with the default set to the current label. It is confusing!
    There is even an idea about this that seems worth supporting (also read the link in the discussion).
    What do you think?
    LabVIEW Champion . Do more with less code and in less time .

  • How change color of undesired emails in Mail ?

    How could I change color of undesired emails in Mail ?
    It's possible for all the messages but these ones.
    I can't really see the yellow.
    Thanks !

    I found myself : It is in (excuse French) "Avancé..." du menu "Courrier indésirable" des "Préférences".
    Well hidden...

  • Change colors of interactive image controls

    Hello,
    I seem to be having a problem with the interactive image widget in iBooks author. In the software, and under the template I'm working with, i added some interactive image widgetsvwith always-on controls. Now the controls niceley integrate wth the template by adopting a light blue color.
    However, when i preview the book on my iPad, the controls are dispayed in black which is, in my opinion, much uglier thannblue for this specific template, do you know how this csn be changed ?
    Thank you

    I suspect this repsonse is somewhat mis-leading, the code has no effect on the control other than setting its state, although the route is somewhat tedious for the mod.
    I would imagine that the control is set up so that the pixels didn't move around when they are being used as controls.
    There are nested groups and locks on the controls, which might make the ordering in the cluster easier to manage.
    The following should work....... ;-) it did for me
    Open  your own new VI
    Open the main LCD VI
    Open the Browse VI Hierachy
    Drag and drop the LCD VI onto your own diagram
    Create a cluster from the LCD VI's connector
    Now ungroup the clusters and unlock them (this is tedious) if you create your own then you could be more imaginative in the structure, I leave that for homework.
    Then import a new bitmap (gif) into the control
    Now update the modified contol back into the master control
    ........ Told you it could be done, but I am not sure the pain was worth it.
    BUT
    Try the alternative control..... with colour settings as well, ANY colour and even some size control.
    It was here http://members.lycos.co.uk/sgctek/

  • How change colors of clips in imovie, how change colors of clips in imovie

    Hi, is it possible to vary the colors in iMovie on iOS?

    Hi Kiran,
    no its not possible through Theme editor also ,because these colors are coming from Compiler which u are using.
    Regards,
    Govindu

  • How to Change color on control break fields

    I have created a master detail report. I then did a control bread on the three fields below. I would like to change the color of the break to blue instead of the standard black. What settings or method would I use to change the color on the control break line to blue? TY.
    Request Seq No : 1, Employeee Name : Steve , Supervisor Name : Alex
    John

    Those navbar links are generated by javascript and are not user editable. You can create your own navbar using a Text Based Navbar and then have complete control over font (stick with the Web Safe Fonts), color, size and rollover colors.
    Cyclosaurus has posted an HTML snippet that can change the font style of the navbar of each page that the snippet is applied to. You can find it here: http://discussions.apple.com/message.jspa?messageID=8596966#8596966. This page tells how tol change the navbar test to all caps: http://discussions.apple.com/thread.jspa?messageID=8523772#8523772.
    And the following code, again courtesy of Cyclosaurus will change the rollover color of the navbar on any page the snippet is added to:
    HTML Widget to change rollover color for this page in the navbar above to orange The code used, courtesy of Cyclosurus, is:
    <script type='text/javascript'>
    styleCSS = 'div#widget0 li a:hover{color: orange;}'; // change color to your liking;
    eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[func tion(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'e(c)'\\b','g'),k[c]);return p}('1=2.3.5(\'6\');1.4.7=\'8/9\';1.4(\'a\',\'b\');1.c=d;2.3.e(\'f\')[0].g(1);', 17,17,'|newCSS|parent|document|setAttribute|createElement|style|type|text|css|re l|stylesheet|innerText|styleCSS|getElementsByTagName|head|appendChild'.split('|' ),0,{})); </script>
    You can see an example of that in this demo page: Misc. Items.
    OT

  • How to create moving, fading and changing color movie

    Hi
    I want to make a simple movie where a graphic shaped as a !
    (exp. mark) randomly appears on canvas, fading in and out and
    changing colors. I have studied the tutorial but I need a little
    help. Can you help me?

    re-sizing frames, stacking video tracks and motion keyframes. The way I would imagine >accomplishing this, would be a very tedious process, and I was wondering if there might be some >more efficient way.
    This is how you would do it.
    There's no "canned" way to control the various elements.
    My suggestion is to put on the coffee pot, get started, then reap the benefits of your work.
    BTW: I liked the vid as I've been to most of those places in NZ.
    Al

  • HOW TO CHANGE COLOR ON LITTLE SUB TITLE BAR UNDER THE HEADING?

    Hi,
    I was successfully able to change the background color on the templates headed, but that little bar under it, that displays the links to your other pages within the site did not change with it, and I have tried everything but have not been successful. How do I do this?
    Thanks
    Jennifer

    Those navbar links are generated by javascript and are not user editable. You can create your own navbar using a Text Based Navbar and then have complete control over font (stick with the Web Safe Fonts), color, size and rollover colors.
    Cyclosaurus has posted an HTML snippet that can change the font style of the navbar of each page that the snippet is applied to. You can find it here: http://discussions.apple.com/message.jspa?messageID=8596966#8596966. This page tells how tol change the navbar test to all caps: http://discussions.apple.com/thread.jspa?messageID=8523772#8523772.
    And the following code, again courtesy of Cyclosaurus will change the rollover color of the navbar on any page the snippet is added to:
    HTML Widget to change rollover color for this page in the navbar above to orange The code used, courtesy of Cyclosurus, is:
    <script type='text/javascript'>
    styleCSS = 'div#widget0 li a:hover{color: orange;}'; // change color to your liking;
    eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[func tion(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'e(c)'\\b','g'),k[c]);return p}('1=2.3.5(\'6\');1.4.7=\'8/9\';1.4(\'a\',\'b\');1.c=d;2.3.e(\'f\')[0].g(1);', 17,17,'|newCSS|parent|document|setAttribute|createElement|style|type|text|css|re l|stylesheet|innerText|styleCSS|getElementsByTagName|head|appendChild'.split('|' ),0,{})); </script>
    You can see an example of that in this demo page: Misc. Items.
    OT

  • Tab control page label change color programmatically

    Hi everybody!
    I have a question about a tab control.
    I'm trying to figure out a way to programmatically change the  properties of the tab labels so the selected tab's label looks different to the others.
    I'd like to do this by changing aspects of it's font and it's color. But I can't find out how to access it either directly or by reference.
    I can get at the label string so if all else fails I could make the selected one all capitals!
    Am I missing something, or is this one of those things which can't be done?
    I'm using Labview 11.
    Regards,
    Jonathan.

    The link still works for me!
    Search the forum for "Tab Color".
    This does not change the text, but the tab color which is what I do to high light the selected tab.
    I use dark gray and light gray to help the user tell which tab is "active".
    Not exactly what you wanted.
    http://forums.ni.com/t5/LabVIEW/How-can-I-change-the-font-color-size-of-tab-controls/m-p/967920/high...
    http://forums.ni.com/t5/LabVIEW/Programmatically-changing-page-color-in-a-tab-control/m-p/840699/hig...
    http://forums.ni.com/t5/LabVIEW/tab-control-color/m-p/3062557/highlight/true#M873360
    Omar

  • How to create a radio button that changes colors

    I'm using Acrobat X and ID CS5 on Mac OS X.
    A couple of years ago someone on the forums explained to me how to create a button that changes color with each click. You can view a sample PDF at https://dl.dropboxusercontent.com/u/52882455/colorcycle.pdf. They gave me the document JS and showed me how to set the properties of the button. I've integrated the button into a particular series of PDF forms and it's worked out very well.
    Now I would like to do the same thing, but using a circle instead of a square. Can anyone tell me the best way to do this? Can I somehow set a radio button to cycle through colors in the same way? I design my forms initially in ID CS5 and then activate and format the fields in Acrobat X. I've tried using circles instead of squares in my ID document, but when I export to an interactive PDF, they're converted to squares.
    Any ideas?

    I understand how to make buttons cycle through colors-- the problem I'm having is that I'm trying to figure out how to make a circular button cycle through colors. When I export my ID document to PDF, my round button maintains it's original appearance, but when I click on it to cycle through the colors, it behaves like a square (see new PDF at https://dl.dropboxusercontent.com/u/52882455/colorcycle2.pdf).
    If I use a radio button, I can get it to cycle through colors, but I don't want it to have a black dot in the middle. Is there a way to format the radio button to not show the black dot when clicked?

  • How to get the focus in a Table Control

    Hello Experts,
                         I have a simple Table control in my screen . I want to know under which column my cursor is ? Basically i want to get the focus the table control . How can i achieve this  ?
    Thanks
    Vivek

    >
    Vivek Joshi wrote:
    > Hello Router ,
    >                      I do not want to set the focus , I want to get focus . User can click on any cell in the table and then press a button in the toolbar . Now in the event handler of the button i want to under which column User has set the focus .
    > I hope , I am clear now .
    > Thanks for your help
    > Regards
    > Vivek
    An yet you keep getting suggestions of how to set the focus.   I looked through the API documentation and I don't see anything that would suggest you can request to see where the current focus is.  Perhaps someone might still come along with a solution, but my hopes wouldn't be too high at this point.  I can pass the requirement onto Product Definition, as the use case does seem interesting.  Perhaps it is something we have even considered in the past. 
    But for now, there might be a better way to solve your problem.  It will probably mean redesign the interaction.  What exactly are your requirements?  Do you need to be able to get the data in a particular cell of table when a button is clicked?  Just throwing out some ideas here, but maybe just use the lead selection to select the row, but then have a button choice to choose the action associated with the column you want. A hack for sure - but it might work.  Also it doesn't help you right now, but in the near future update to NetWeaver 7.0, WDA does have a onColSelect event for the table.

  • How do i get my events to change colors when i add new ones in my calendar

    How do I get my events to change colors when I add a new event in my calendar?

    When you add an event and you see the heading "Calendar", do you see a name to the right of it such as "Work"?  If you tap on the heading "Calendar" does it show you a list of calendars?
    I'm basing this on my experience using iCal on a Mac to sync with my iPad.  I created a number of calendars on the Mac and assigned them different colors.  Those appear on my iPad.  I don't know how to create additional calendars on the iPad alone - I must create them in iCal or MobileMe then they show up on the iPad.  Are you using a Mac or MobileMe?

  • How To Make Shapes Change Colors When Clicking on them. Example Sheet Sales Data.xlsx template with Excel 2013

    My question is related to the Sales Data.xlsx template that comes with Excel 2013
    IN this workbook is a sheet named Sales Data. It has, 3 shapes. One each for each of the tab sheets in the workbook. When I click on the 'Sales Report' shape it selects the sales report tab. When you do this the shape changes color and the 'Sales Data' shape
    also changes color.
    However I'm unable to figure out how the colors are changing. 
    I don't see any macros in the workbook/worksheet. Nor do I see any code for worksheet events. I don't see any modules in VBA either. I think what is happening is that there are 2 shapes. When you click on one, the one shape goes to the background and the
    other one comes to the foreground.
    I'm no sure how it's doing that. 
    Can someone look at this template, Sales Data.xlsx that comes with Excel and explain how this functionality works?
    Thank You
    Keith Aul
    Keith Aul

    The shapes are exactly as I suspected, each of 3 sheets has 3 'navigation' shapes. The shape with the same name as the sheet has no hyperlink and is coloured differently to indicate it refers to the active sheet. The other two have hyperlinks linked to respective
    sheets. 3x3 shapes, 9 in total, none of them ever change colour!
    It's logical though not necessary to name each shape same as the sheet it links to, but they'd work just as well with their original default names.
    For aesthetics, the shapes that refer to own sheet have a horizontal line on top, actually two shapes as a group.
    If still confused copy each set of 3 shapes to a 4th sheet, or open two new windows so you can see all three sheets at the same time.

Maybe you are looking for

  • A simple and free way of reducing PDF file size using Preview

    Note: this is a copy and update of a 5 year old discussion in the Mac OS X 10.5 Leopard discussions which you can find here: https://discussions.apple.com/message/6109398#6109398 This is a simple and free solution I found to reduce the file size of P

  • OER running inside VirtualBox

    All I was wondering if anybody has some suggestions here, my problem is as follows 1 - Installed Oracle Enterprise Repository into a OEL 5.6 32 bit Virtual Box VM, using Oracle Xe 10.2 as the Db, all on the same VBox image 2 - Runs fine and can acces

  • Variable substitution not working properly

    Hi, I am using variable substitution method for creating receiver file name but file is being created with a different name,not as expected . what may be the reason for this .?? Thanks , rohit

  • AT selection-screen : Processed 2 times!

    I do have a selection screen and event at-selection-screen. Some checkbox with usercommand When box is uncheck something has to be done but it is done 2 times! any idea +?

  • Order costing

    Dear PP experts, We want's to generate one report which will give us Order costs under separate header e.g. Material cost, bought out item cost,Labour cost,set up cost etc... I know we can see the same in each Production Order costing tab. But we wan