How do I make a button transparent - javafx-2

I am making a javafx application where there's a border pane with a background image. The buttons on this border pane are supposed to be transparent. I can't seem to be able to accomplish this using blend modes and I can't. Please help me!!!
Sorry I can't post the code

css :
.button{
-fx-background-color: transparent;
}
Javafx code :
Button buttonColor = new Button("Color");
buttonColor.setStyle("-fx-background-color: transparent;");

you can simply using
button.setVisible(false);
to make it transparent, if you want to make it appears again, just using
button.setVisible(true);

Related

How do I set a background colour for QTextBrowser?? (PyQt)

I have created a QTextBrowser and I wanted to know how i would set the background colour of the whole widget.
I have tried QTextBrowser.setBackground(QtGui.QBrush(QtCore.Qt.blue, QtCore.Qt.SolidPattern)) with no luck.
In this case I suggest you to use stylesheet:
If in QDesigner, right click on the control, click "Set Stylesheet" and write
background-color: blue;
If you want to do it by code, just use
YourControlTextBrowser.setStyleSheet("background-color: blue;")

JavaFX Scene Builder: pointer cursor onMouseOver

Is it possible to set the mouse cursor to become a pointer (hand) when hovering a Node width JavaFX Scene Builder? How?
You can add the following Style to the Node in question:
-fx-cursor: hand;
For additional options, check out the JavaFX CSS Documentation
for the new one you can use this in your css file
.glyph-icon{
-fx-fill: White;
}
.glyph-icon:hover{
-fx-cursor: hand;
-fx-fill: black;
}
`
In the latest Version of Gluon Scene Builder (v11+), this feature is available under the Properties > Cursor with a few other options as well.
The good thing about this feature is that the cursor is updated while you view the options, i.e how will setting that property look like as shown in the below GIF.

Javafx Image and Text align on Button

I created a javafx button and added image and text.I want text place to top and image place to middle of the javafx button.Is it possible with javafx and how can I do it?
You have to use button.setContentDisplay(ContentDisplay.TOP);
ContentDisplay
You can also use CSS for the button. The below example will display the text at the top with the image below (which seems counter-intuitive) for all buttons:
.button
{
-fx-content-display: bottom;
}

How to remove the dark shadow of the screen when a Dialog is shown?

When a Dialog is shown then the background of screen is darkened. I want to remove this darkness so that the screen looks like normal. How to achieve that ?
When you show a Dialog the background becomes a Form, changing its style you can modify the background of a Dialog. I don´t really know if you can make this Form transparent. I use the LWUIT-Theme creator and modifiying the Form´s style, I can change the background for an image o for one colour.
Try it here!
http://lwuit.java.net/
Set the tint color of the parent form, you can also set this in the look and feel class and within the theme constants in the resource editor.
just add below code on your dialog:
dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);

ScrollBar in LWUIT

How can I edit the style of the lists´ scrollbar?
I want to modify its width, mainly.
To change his colors I use the UIID ScrollThumb, is this correct?
Thanks
#Shai Almog shows me how to edit the ScrollBar.
Using the UIIDs "Scroll" and "ScrollThumb", I can customize my apps´ scroll. Modifying padding/background I can control the width.
There are so many examples in the LWUIT svn.

Resources