javafx-8

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

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

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

configure a custom variant in HijrahChronology for date correction jdk 8

拥有回忆 提交于 2020-01-02 09:58:27
问题 I have used DatePicker in javafx - JDK 8 and used HijrahChronology.INSTANCE - so that the date picker shows both the calendar - everything work good enough but I am having a difference of 1 day between gregorian calendar and hijri calendar. Hijri Calendar is 1 day backward. I am trying to change the variant as per the following link https://bugs.openjdk.java.net/browse/JDK-8187987 but unable to succeed in it. Kindly explain or refer a better or a clear solution to this issue. Code:

Eclipse/java9-jigsaw: how to access javafx packages?

若如初见. 提交于 2020-01-02 09:13:21
问题 My context: 9-ea-113 (that is javafx now fully modularized, without jfrt.jar) eclipse-neon-M6 with the current beta support for java9 (running on java8, if that matters) win7 Something simple like import javafx.application.Application; public class FirstApplication extends Application { // } doesn't compile because the javafx.xx packages are not found. What to do? 回答1: Edit the .classpath file of the project and add the entry below - seems to work. <classpathentry kind="con" path="org.eclipse

Eclipse/java9-jigsaw: how to access javafx packages?

泄露秘密 提交于 2020-01-02 09:13:02
问题 My context: 9-ea-113 (that is javafx now fully modularized, without jfrt.jar) eclipse-neon-M6 with the current beta support for java9 (running on java8, if that matters) win7 Something simple like import javafx.application.Application; public class FirstApplication extends Application { // } doesn't compile because the javafx.xx packages are not found. What to do? 回答1: Edit the .classpath file of the project and add the entry below - seems to work. <classpathentry kind="con" path="org.eclipse

Form validator message

拜拜、爱过 提交于 2020-01-02 06:56:21
问题 I'm looking for form validator similar to these examples: or Is this custom JavaFX component or this can be done using standard JavaFX? Is there any example how I can create form validator similar to these? 回答1: Just to give you a kick start, here is a small example with using ContextMenu. May be ContextMenu is not an ideal Control for this scenario and you are free to replace it with Label, Text etc. Keep the TextField and Label inside a HBox (with Label being hidden initially) and the HBox

JavaFx how to align only one column-header in tableview?

馋奶兔 提交于 2020-01-02 05:31:08
问题 How to align title of only one column in tableview? The following css aligns all column-header but I want to align just one column: .table-view .column-header .label{ -fx-alignment:CENTER } 回答1: You can do that now with recent versions of JavaFX. Java 1.7 This worked for me with Java: 1.7.0_45 / JavaFX: 2.2.45-b18). It should be a recent version because it requires RT-14909 The column-header will automatically get the same "Id" as the TableColumn! Therefore your TableColumn(s) need an (CSS-)

JavaFX, ObservableList: How to fire an InvalidationListener whenever an object of the list gets modified?

笑着哭i 提交于 2020-01-01 19:30:44
问题 Say I have a JavaFX app with an observable class SomeObservableClass with some Properties: public class SomeObservableClass{ private StringProperty prop1 = new SimpleStringProperty(); private DoubleProperty prop2 = new SimpleDoubleProperty(); ... constructors, getters and setters } and another class which has a property: public class ParentClass{ private ObservableList<SomeObservableClass> sOC = FXCollections.observableArrayList();` } In this parent class I add a listener for the observable

JavaFX strange menu accelerator behaviour

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 19:24:48
问题 I noticed a really strange behaviour with menu accelerators on the JavaFX (system) menu. Some key combinations don't work at all and others are interpreted as the wrong key. For instance, when you use the CMD+CLEAR key as accelerator, it gets changed as the CMD+Page Down down key (both in the menu text and in the actual response to a keyboard event). The '-' (MINUS) key doesn't work well at all and while, CMD + - shows up well in the menu, it never gets triggered when you press the keys. When