javafx

Why is this CSS property not detailed in the JavaFX CSS Reference Guide?

牧云@^-^@ 提交于 2020-01-23 12:29:09
问题 I'm learning how to use CSS to style UI components in JavaFX, and in going through Oracle's tutorials I found the color property -fx-base in a piece of example code: http://docs.oracle.com/javase/8/javafx/user-interface-tutorial/button.htm (example 3-5, the very last piece of code on the page). In the complete JavaFX CSS Reference Guide (http://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html), there is clear documentation on every property I have seen so far EXCEPT -fx

ControlsFX: CheckComboBox Popup Styling

倾然丶 夕夏残阳落幕 提交于 2020-01-23 12:15:09
问题 I am trying to style the actual popup menu (not the cells, because I believe I can style those). I have tried using the ".combo-box-popup" selector and the ".combo-box-popup .list-view" selector to no avail. I believe this is because the CheckComboBox delegates to an internal ComboBox and so the usual styling doesn't work, but I may be wrong. I have even tried (after searching through the code) to get "at" the popup itself but couldn't figure out a way to do this. I am only able to style the

How load css file in javafx8

不想你离开。 提交于 2020-01-23 09:51:07
问题 javafx 8 this code is not working scene.getStylesheets().add("appCssFile.css"); give Exception Mar 25, 2014 12:21:20 PM com.sun.javafx.css.parser.CSSParser reportException WARNING: Please report java.lang.NumberFormatException at: Mar 25, 2014 12:21:20 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged WARNING: Resource "appCssFile.css" not found. How can i load css ? 回答1: You need an URL and call toExternalForm in order to load a css file into your project. Use the ClassLoader for

JavaFX: setting background color for Text controls

笑着哭i 提交于 2020-01-23 08:33:32
问题 I'm using a TextFlow and some Text items to show a styled text, but i cant find a way to set a simple background color for the Text items. I can set the fill color and font but it does not have a java method or css property that sets its background color. 回答1: Based on this solution, this is a quick implementation of a method to provide background coloring for all the Text nodes within a FlowPane , using CSS and the ability to set a series of paint values separated by commas (as much as Text

How to render 3D text in JavaFX?

最后都变了- 提交于 2020-01-23 07:36:11
问题 I'm making my first JavaFX project and I need to render some 3D text. I already put a PerspectiveCamera and I display a text node but it has a Z-dimension of 0 and I don't know how to change this. Thanks in advance! 回答1: Have a look at the FXyz project. It already contains a Text3DMesh class that will allow you generating a 3D mesh for any string and font you need. Under the hood there is a complex process of converting (2D) Text to Path, Delaunay triangulation and mesh extrusion. As a result

Textflow inside Tablecell: not correct cell height

旧时模样 提交于 2020-01-23 02:38:18
问题 I wont to place formated text inside a JavaFX table. First I was trying to embedd a Webview but I had problems with cell heigh. This seems to be a mission feature in JavafX (see: Java FX: TableView - display simple HTML). Based on the recommendation here I tried to embed a TextFlow. However again the sizing of the TabelCell is not correct. I want the height of the row just as big, that the content of the cell fits inside. Changeing the column width should result in changeing the row heigth.

JavaFX Alert truncates the message? [duplicate]

我是研究僧i 提交于 2020-01-23 01:00:22
问题 This question already has answers here : JavaFX Alerts and their size (4 answers) Closed 2 years ago . I noticed that if I try to show an Alert with a long message, it tends to get truncated (at a word boundary). Example: import javafx.application.Application; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; import javafx.stage.Stage; public class AlertTest extends Application { @Override public void start(final Stage primaryStage) throws Exception { new Alert

JavaFX ReadOnlyListProperty not read only?

别说谁变了你拦得住时间么 提交于 2020-01-23 00:44:07
问题 This code throws an UnsupportedOperationException, as I would expect it to since it's read only. ListProperty<String> lp = new SimpleListProperty<String>(); ReadOnlyListWrapper<String> rolw = new ReadOnlyListWrapper<String>(lp); ReadOnlyListProperty<String> rolp = rolw.getReadOnlyProperty(); rolp.add("element"); However, this code does not. ObservableList<String> ol = FXCollections.observableArrayList(); ReadOnlyListWrapper<String> rolw = new ReadOnlyListWrapper<String>(ol);

How to automatically resize windows in JavaFx for different resolutions?

时光毁灭记忆、已成空白 提交于 2020-01-22 20:14:49
问题 I have the following problem: I have created a JavaFX window on a desktop with full hd, and I set the scene like this: Scene scene = new Scene(root,1475,1015); When I run the application on a laptop with 1360*760 resolution, I can't see the whole application and I can't resize it. How can I set my application to resize automatically in function of the desktop/laptop and it`s resolution and dimensions? 回答1: I believe you are looking for this GraphicsDevice gd = GraphicsEnvironment

Error: Could not find or load main class application.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application JDK 11

試著忘記壹切 提交于 2020-01-22 12:59:05
问题 I am stuck at a very basic problem. I have created a simple hello world program using JavaFX which works fine on JDK 1.8. But when I switch to JDK-11 it throws following exception: Error: Could not find or load main class application.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application Following is the code I wrote in eclipse. package application; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.stage.Stage; import javafx.scene