JavaFX Changing Button Color - javafx

I have a button that I change to the color green using
button.setStyle();
Now I need to make it back to the default color. How would I do that?

You can clear the styles you have set with button.setStyle("");

Related

Label Focus Color Change in s:label

I want to change the text color of the S:Label control on rollover by changing the style i want to change the text color to different. can any one please help me. For example i mouse over on Label the text of the color should change to green but not background color.
In actionscript add a mouse over listener and mouse out listener to the label. In the function for mouse over just put in:
label.setStyle("color","#00FF00");
and on the mouse out revert it back to #000000 for black.
Note: In actionscript color normally refers to text color and you get a seperate variable for the background normally used as backgroundColor.

Twitter Bootstrap's Element Border Color

I want to change the border color of any element when it gets focused from blue to green. The problem is I don't know the attribute name I should change to override this. Any help would be very much appreciated.
Below is an image for better comprehension:
Go to http://getbootstrap.com/customize/, look for #input-border-focus, enter your desired color code, scroll down and click "Compile and Download".

How to give back groundcolor to widget?

i my qt application i have a window and i set the background color of the window as white using "Change stylesheet'when i placed a button its background color is also the white.....i want the green window with button with a background color of grey...how to achieve this?
You need to set the autoFillBackground property to true on the widget.
Otherwise the background color, you have selected, will have no effect.
If this is not the case, please write a better description of the problem.

Change color of a Flex 4 spark Button

Is there an easy way to change the background color of a Flex 4 spark Button without messing with skins?
UPDATE: ok, figured it out, simply set the chromeColor attribute of the Button mxml.
For spark components, you can use chromeColor style:
<s:Button chromeColor="0xff0000" label="chrome red"/>
You can change the color style of the button. You can also have a bitmap fill.
Update: The above methods do not change the background.
Easiest way to change the background, you can use - opaqueBackground property.
Here is another way to change the background of a button without changing its skin -
1. Create a group with a rectangle and your button.
2. Set opaqueBackground of your button to null.
3. Make width and height of rectangle to 100%
4. whatever color you fill the rectangle with is the background of your button.
This can also be done via code like :-
btnID.addEventListener(MouseEvent.MOUSE_OVER, textChange);
btnID.addEventListener(MouseEvent.MOUSE_OUT, textChangeback);
private function textChange(event:MouseEvent):void
{
btnLinkDelete.setStyle("color", 0xFFFFFF)
btnLinkDelete.setStyle("chromeColor", 0x535151)
}
private function textChangeback(event:MouseEvent):void
{
btnLinkDelete.setStyle("color", 0x000000)
btnLinkDelete.setStyle("chromeColor", 0xfcffff)
}
I am posting it, if anyone want to change background color on mouse hover.

how to change css control font color using colorpicker

im using colorpicker for fontcolor. i want to know when i choose any color from colorpicker, all text color shuld change to choosen color. is it possible to use css to over come the probelm .thanks
Add an event handler to the change event of the colorpicker and assign the selectedColor property as the color style of the application.
application.setStyle("color", colorPicker.selectedColor);

Resources