-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't change background properties of an InlineCssTextArea #29
Comments
Thanks for reporting. You can now use area.setStyle("-fx-background-color: yellow;"); in your Java code, or .styled-text-area {
-fx-background-color: yellow;
} in your stylesheet. |
Thank you for answering so quickly. Unfortunately, I downloaded the newest fat JAR and tried both of those but to no avail. It's still the same white background. Are there any other lines of code that I need to be sure to put in before this will work properly? Thanks again. |
This example works for me with this fat jar: import org.fxmisc.richtext.InlineCssTextArea;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.layout.StackPane;
public class BackgroundColor extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
InlineCssTextArea area = new InlineCssTextArea();
area.setStyle("-fx-background-color: yellow;");
Scene scene = new Scene(new StackPane(area), 600, 400);
primaryStage.setScene(scene);
primaryStage.show();
}
} |
Thanks a lot! It works now. I must have downloaded the wrong version or something. |
Thanks! |
Hi Tomas, did you change jar version in the link above? because i downloaded it and have two issues: |
Text area contains a ListView, whose background color is white by default. What I did here was to set this ListView's background color to transparent, so that any background color you set on the area can shine through. My guess for your whitesmoke background would be that something of a whitesmoke color is shining through from underneath the text area, but then setting the background color of the area to white would have fixed it. So I'm not sure what exactly is going on in your case. Anyway, I now set the default background color of text area to white, so please redownload and report back. |
Ok I will try that now. On Wed, Apr 2, 2014 at 7:25 AM, TomasMikula [email protected]:
|
Ok Now it is white. I found the issue. the "-fx-highlight-fill" causes the background color to reset to its default (now white). And it is affected by the order in which they are called. This order gives a red background for the text area, with blue highlighting This order gives a white background with blue highlighting. |
Maher, it is not the "-fx-highlight-fill". It's simply that In richText.setStyle("-fx-highlight-fill: blue;");
richText.setStyle("-fx-background-color: red;"); "-fx-highlight-fill: blue;" has no effect. In richText.setStyle("-fx-background-color: red;");
richText.setStyle("-fx-highlight-fill: blue;"); "-fx-background-color: red;" has no effect. |
Is it possible to set the background colour and/or opacity of an InlineCssTextArea? I can't seem to find a way to do this anywhere. I originally had a TextArea in my project and switched it for an InlineCssTextArea for rich text support, but the CSS I used before no longer works. If this is not supported, is there a chance of it being added any time soon?
I'm using the newest JAR, 1.0.0-20140327. Thanks in advance.
The text was updated successfully, but these errors were encountered: