javafx

Custom palette in the ColorPicker

夙愿已清 提交于 2020-01-02 20:10:27
问题 I would like to change the color palette. The colors are by default have a transparency of 30%. Is it possible to replace the color palette? 回答1: Based on this solution, you can replace the color palette once you get the rectangles and their colors. For instance, you can make brighter all the palette: @Override public void start(Stage primaryStage) { ColorPicker picker = new ColorPicker(); StackPane root = new StackPane(picker); Scene scene = new Scene(root, 500, 400); primaryStage.setScene

scenebulider not able to open fxml file

旧城冷巷雨未停 提交于 2020-01-02 20:10:19
问题 I'm creating an app in JavaFX. I received this error while opening the scenebuilder: "Could not open Loggin.fxml. Open operation has failed. Make sure that the chosen file is a valid fxml document." Clicking on "Show details", it shown me this error: java.io.IOException: javafx.fxml.LoadException: /F:/Anusha/stophubsourcetree3/src/application/GetStarted.fxml at com.oracle.javafx.scenebuilder.kit.fxom.FXOMLoader.load(FXOMLoader.java:92) at com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument.

Custom palette in the ColorPicker

若如初见. 提交于 2020-01-02 20:10:11
问题 I would like to change the color palette. The colors are by default have a transparency of 30%. Is it possible to replace the color palette? 回答1: Based on this solution, you can replace the color palette once you get the rectangles and their colors. For instance, you can make brighter all the palette: @Override public void start(Stage primaryStage) { ColorPicker picker = new ColorPicker(); StackPane root = new StackPane(picker); Scene scene = new Scene(root, 500, 400); primaryStage.setScene

Populating a TableView with a HashMap that will update when HashMap changes

删除回忆录丶 提交于 2020-01-02 18:14:29
问题 I have followed this post Binding hashmap with tableview (JavaFX) and created a TableView that is populated by data from a HashMap. The TableView receives its data from a HashMap called map by creating an ObservableList from map.entrySet() and handing that ObservableList off to the TableView 's constructor. (Code is below) However, although it's an ObservableList with SimpleStringProperty s, the TableView does not update when changes are made to the underlying HashMap. Here is my code: public

Logger entries translated to the UI stops being updated with time

Deadly 提交于 2020-01-02 18:05:46
问题 I have a javafx.concurrent.Task that run some code in background and use the java.util.logging.Logger to give information about its status. I need to show this log entry in the UI in the main thread. how can I do this? this is a simple toy project I've made to solve the problem out of the context @Override public void start(Stage primaryStage) { ListView<String> list = new ListView<>(); final ObservableList<String> items =FXCollections.observableArrayList (); list.setItems(items); Task<String

JavaFX application hide OSX dock icon

 ̄綄美尐妖づ 提交于 2020-01-02 16:23:10
问题 I need to hide the dock icon of my javafx application. In a normal java application this can be achieved by the following property: System.setProperty("apple.awt.UIElement", "true"); However, this does not seems to work with JavaFX. Thanks! 回答1: Just tried it. You have to modify *.app/Contents/Info.plist and add <key>LSUIElement</key> <string>1</string> Simple example: <?xml version="1.0" ?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

JavaFX 11 in Netbeans 10 (with Maven) has no Sources/Javadocs

余生颓废 提交于 2020-01-02 14:11:17
问题 I tried out the JavaFX tutorial for Netbeans with Maven and got it running without a problem. Maven found the artifacts, downloaded them, build the project and started it. But I get no code completion (Missing sources and Javadocs). I tried to download the sources and javadocs for the maven dependencies in Netbeans, but only the sources/javadocs for the wrapper artifacts (e.g. the empty javafx-controls-11) are available. But no sources are found for the actual implementation (e.g. javafx

JavaFX: optimal width of TextFlow with word-wrap

喜欢而已 提交于 2020-01-02 10:26:26
问题 With Textflow.setMaxWidth(double) I can achieve text wrapping. But how can I adjust the width of TextFlow afterwards so that it is based on the actual wrapping position? In other words, how to let the TextFlow bounds snap to all of its children Text bounds to get rid of the empty space on the right: **Edit** I have made some progress on this issue. My class derived from TextFlow now contains: double maxChildWidth = 0; for (Node child : getManagedChildren()) { double childWidth = child

javafx make a grid of buttons

谁说胖子不能爱 提交于 2020-01-02 09:59:57
问题 I want to make a grid with a specific amount of buttons. I know how many buttons there are need to be because I get the number of rows and columns. I could do a loop, but I don't know how you can place buttons next to eachother and underneath. Secondly, the buttons need a Text and an Id, text is no problem, but how do you give them an id? And at last, and probably most difficult, it can occur that there are a lot of rows, so that a scrollbar should be available. At the end it should look

WizardPane : Disable 'Previous' button on a screen

故事扮演 提交于 2020-01-02 09:58:52
问题 How can I disable the 'Previous' button on my Screen of the ControlsFX WizardPane ? I am trying it with this method prev.setDisable(true) but what I have is NullPointerException . public class MainApp extends Application { Wizard wizard = new Wizard(); WizardPane1 page1 = new WizardPane1(); WizardPane page2 = new WizardPane(); WizardPane page3 = new WizardPane() { @Override public void onEnteringPage(Wizard wizard) { Node prev = lookupButton(ButtonType.PREVIOUS); prev.setDisable(true); } };