javafx

Is it possible to, in JavaFX, have a scene, stage, and control that are all transparent?

让人想犯罪 __ 提交于 2020-01-03 04:46:11
问题 I have a custom control which is 3 simple buttons. The control handles operations for the application to which it is tied, but it must reside on an external stage for reasons. The thing that is annoying about it is that between all buttons is a white background. I've tried all of the following to eliminate it: Init StageStyle to Transparent Declare Scene with a transparent background : new Scene(Node, X, Y, Color.TRANSPARENT); Declare Scene with a NULL background : new Scene(Node, X, Y, null)

How to effectively scroll and zoom big images in JavaFX?

时光怂恿深爱的人放手 提交于 2020-01-03 04:28:12
问题 As a part of image processing application I need to create simple viewer module with zooming, scrolling and vector overlay features. Images are quite big: ~40000x20000 which makes operations on ImageView slow, buffering, etc. What are the best options to improve user experience when working with huge images in JavaFX? 回答1: I have a 8k by 4k image that scales fine by caching the scroll pane I have have placed it in and using this code for zooming. Only problem with scroll pane and large images

Update JavaFX scene graph from a Thread

泪湿孤枕 提交于 2020-01-03 04:24:50
问题 I need to update my GUI based on client input. Calling my controller class method, from the background task works. But it can't update the GUI, because it is not the JavaFX application thread..please help. I tried many of the related Q & A, but I am still confused. Should I use Platform. runLater or Task ? Here's my class where I create an instance of controller class public class FactoryClass { public static Controller_Gui1 createGUI() { FXMLLoader fxLoader = new FXMLLoader(); fxLoader

creating nested TreeItem in javafx

亡梦爱人 提交于 2020-01-03 04:17:25
问题 At the time my TreeItem in TreeTableView looks flat and like this: //////////////////row////////////////////////////// for (Entry<String, String> entryRow : dc.getSortedfuncAll().entrySet()) { root.getChildren().add(new TreeItem<String>(entryRow.getValue())); } // ////////////////treetable//////////////////////////// final TreeTableView<String> treeTableView = new TreeTableView<>(root); AUF_1086686287581_9999 AUF_1086686329972_10049 AUF_1079023138936_6682 AUF_1087981634453_7022 AUF

JavaFX Sync Duplicate Views to the Same Controller (FXML & MVC)

无人久伴 提交于 2020-01-03 03:16:14
问题 Below is a small Application that illustrates the problem: ButtonPanel.fxml <ScrollPane fx:controller="ButtonPanelController"> <VBox> <Button fx:id="myButton" text="Click Me" onAction="#buttonClickedAction" /> </VBox> </ScrollPane> ButtonPanelController.java public class ButtonPanelController { @FXML Button myButton; boolean isRed = false; public void buttonClickedAction(ActionEvent event) { if(isRed) { myButton.setStyle(""); } else { myButton.setStyle("-fx-background-color: red"); } isRed =

How to fix jvm options exports javafx 11 to com.jfoenix on gradle idea?

柔情痞子 提交于 2020-01-03 03:13:08
问题 It's been 3 days that I look on the internet how to fix this on gradle Caused by: java.lang.IllegalAccessError: class com.jfoenix.skins.JFXTabPaneSkin (in module com.jfoenix) cannot access class com.sun.javafx.scene.control.behavior.TabPaneBehavior (in module javafx.controls) because module javafx.controls does not export com.sun.javafx.scene.control.behavior to module com.jfoenix On simple idea projects I was adding --add-exports javafx.controls/com.sun.javafx.scene.control.behavior=com

running dll method Javafx

孤人 提交于 2020-01-03 02:54:18
问题 I have C program (Dll) which I can call from Java using JNI. I want to use Javafx for the interface so I made a java class to call the dll. I am able to load the dll but I cannot call the method. The error message it gives me is java.lang.UnsatisfiedLinkError: mark1.Small_test.tester(DDDLjava/lang/String;Ljava/lang/String;Ljava/lang/String;DDD)[D java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl

Exposing properties for binding

荒凉一梦 提交于 2020-01-03 02:33:20
问题 How should properties be exposed? For example: class A{ private ObjectProperty<X> objx; } class B{ private ObjectProperty<X> objy; } We want to bind objy to objx or add a listener to objx from B . Is it fine to just make a getter for objx ? or is there a way to make a wrapper function for binding and expose just this function? 回答1: The standard pattern is class A { private final ObjectProperty<X> objx = new SimpleObjectProperty<>(); public ObjectProperty<X> objxProperty() { return objx ; }

Create a null-safe BooleanBinding with JavaFX 8

こ雲淡風輕ζ 提交于 2020-01-03 01:17:32
问题 I need help creating a null -safe BooleanBinding . It has to be null -safe since I can not provide default values for all attributes in the model (one reason: the model contains enumerations). My first approach has been as follows: executeButtonDisabled.bind(missionProperty().isNotNull().and(missionProperty().get().statusProperty().isNotEqualTo(MissionStatus.CREATED))); final BooleanBinding isNotExecutingBinding = missionProperty().isNotNull().and(missionProperty().get().statusProperty()

How to delete a color of an image with JavaFx (make the background transparent)?

心已入冬 提交于 2020-01-02 22:02:53
问题 I have an image loaded with Image and ImageView . I want to make the background of the image, which is white, transparent to match with the background. 回答1: See the resampling technique using a PixelWriter and WritableImage used in Reduce number of colors and get color of a single pixel. You can use the same technique and change the white pixels (rgb 255,255,255) to transparent (rgba 0,0,0,0). You could also do this in an image editing program before you use the image in your application.