javafx

Exception in Application start method. JavaFx 11

佐手、 提交于 2021-01-28 08:05:19
问题 I try to create a screen with one TextField and Button and receve "Exception in Application start method". Firt time I try solution from this questions and dont work: Exception in Application start method Exception in Application start method javafx gui JavaFX "Location is required." even though it is in the same package Exception in Application start method error. Other solutions not working I use Java 11, javaFx 11. For javaFx I use maven. The main class is : import javafx.application

Using Arial Unicode MS BOLD in JavaFX

江枫思渺然 提交于 2021-01-28 07:54:43
问题 I want to use the font Arial Unicode MS in my JavaFX project which works fine. But i want e.g. the headlines to be bold. But I don't get the bold font working. What's the probleme here? I tried it with css and within the code directly .bold-font { -fx-font-family: Arial Unicode MS; -fx-font-weight: bold; } and label.setFont( Font.font("Arial Unicode MS", FontWeight.BOLD,24)); Nothing worked and when i check the font after setting with "getFont()" it is still regular. 回答1: i checked few

Jackson/Gson serialize and deserialize JavaFX Properties to json

两盒软妹~` 提交于 2021-01-28 05:30:29
问题 I have added a BooleanProperty into a DAO class which is to be serialized into JSON and sent across to a server to be saved in a MySQL database. The reason I am using the BooleanProperty is because I want to use data binding for the 'isActive' field in my JavaFX desktop application. The class to be serialized: package com.example.myapplication import lombok.Data; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; @Data public class MyDAO {

Cannot run python script from java jar

前提是你 提交于 2021-01-28 05:22:16
问题 While working in IntelliJ everything worked but after I built jar it stopped. At first, it was just me forgetting to put it in jar build config, but now after making sure it is there, I still can't run it. These are ways I try: InputStream script = mainView.class.getResourceAsStream("vizualize3D.py"); Process process = new ProcessBuilder("python3", "-").start() ; Process p1 = Runtime.getRuntime().exec("python3 " + script); Runtime rt = Runtime.getRuntime(); Process pr = rt.exec("python3 " +

JavaFX GraphicsContext clearRect doesn't work with clip mask

对着背影说爱祢 提交于 2021-01-28 05:13:32
问题 The documentation for the clearRect method of GraphicsContext states that it uses the current clip, but this isn't currently working for me. Consider: GraphicsContext context = canvas.getGraphicsContext2D(); context.beginPath(); context.rect(0,0,100,100); //Set the current path to a rectangle context.stroke(); //Highlights where the current path is context.clip(); //Intersect current clip with rectangle context.fillOval(80, 80, 40, 40); //This correctly draws the oval clipped context

How to scale Label within a ListView in JavaFX

主宰稳场 提交于 2021-01-28 05:08:23
问题 I have a ListView with some Labels in it. The labels' width property is bound to the width property of the ListView but they seem to be slightly larger meaning that a horizontal scrollbar is shown on the list view. What I want is to fit the labels in the list view without the scrollbar on the bottom. I have looked at various padding and insets values on both the label and the list view but none I have found are the culprit (most are zero). Here is an example which demonstrates the problem.

How to Save/Load editable Fall tree in javafx?

旧街凉风 提交于 2021-01-28 05:06:33
问题 i have a editable fall tree which i want to save and load here is my code public class Muddassir extends Application { private BorderPane root; TreeView<String> tree; TreeItem<String> module,unite,translateA ,translateB,rotate; @Override public void start(Stage primaryStage) throws Exception { root = new BorderPane(); root.setLeft(getLeftHBox()); root.setTop(getTop()); Scene scene = new Scene(root, 900, 500); primaryStage.setTitle("BorderPane"); primaryStage.setScene(scene); primaryStage.show

How to Save/Load editable Fall tree in javafx?

 ̄綄美尐妖づ 提交于 2021-01-28 05:03:15
问题 i have a editable fall tree which i want to save and load here is my code public class Muddassir extends Application { private BorderPane root; TreeView<String> tree; TreeItem<String> module,unite,translateA ,translateB,rotate; @Override public void start(Stage primaryStage) throws Exception { root = new BorderPane(); root.setLeft(getLeftHBox()); root.setTop(getTop()); Scene scene = new Scene(root, 900, 500); primaryStage.setTitle("BorderPane"); primaryStage.setScene(scene); primaryStage.show

How to sync JavaFx and Swing Look and Feel

邮差的信 提交于 2021-01-28 04:18:36
问题 I have JavaFx application in which I embedded the swing components. Look and Feel of JavaFx and Swing components differs. So I am in search of solution which can address this issue and provide common look and feel so that application looks more professional and accepted by user. Any help is greatly appriciated. 回答1: Two options, neither of which have really good general solutions at the moment IMO: 1. Match the system look and feel In Swing set UIManager.setLookAndFeel(UIManager

Where can I find a complete official reference on JavaFX CSS?

血红的双手。 提交于 2021-01-28 04:05:54
问题 When I want to change the background colour of my TextArea in JavaFX (with CSS), many people recommend "-fx-control-inner-background" . But when I look up the Oracle's CSS reference there's no such a thing as "-fx-control-inner-background" ! In fact nowhere, in the Internet I could find a reference on that and yet it works ! My question is where do these people discover this information? Why, for example, isn't -fx-background-color working instead? 回答1: Note that -fx-control-inner-background