javafx

JavaFX WebView font issue on Mac

亡梦爱人 提交于 2021-02-17 20:26:36
问题 Some sites show gibberish characters instead of the correct text. It only happens on Macs. For example with GMapsFX: Online site: Might be related to OS X 10.11 or 10.12. I tested it with Java 1.8.0_121. Is there any fix or workaround for this issue? 回答1: The error, in my case, was not related to system font. I solved the problem by setting the user agent for the web engine. Here is the string I used (Firefox on Windows x64): Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0) Gecko/20100101

Place an object inside an SVG in javafx

隐身守侯 提交于 2021-02-17 07:15:06
问题 I am making Risk in java with javaFX. I have the map displayed in an fxml file, with every country having an SVGPath. I want to know how can I put a circle with a number inside it, in the centre of the SVG. I am hoping I can do this in the CSS but so far I cant get it working. My SVGPaths look like this: <SVGPath id="Egypt" styleClass="grey-country, africa, country" content="M484 328c8,2 15,10 23,9 0,-4 0,-4 1,-7 12,-3 24,4 35,8 5,0 9,0 14,0 1,5 3,10 4,15 -2,0 -4,-1 -6,-1 2,9 5,17 7,26 -3,1

Limit TextField to a specific range of number JavaFX?

六月ゝ 毕业季﹏ 提交于 2021-02-17 05:13:19
问题 Hi I need to limit the input of TextField javaFX not only for integer but also for numbers between 1 - 19 only.For example I should be allowed to type : "3" ,"19" ... but not: "33" , 44 .. for example : What is the recommended way to make a numeric TextField in JavaFX? but this limits the text field just for integers. 回答1: You can use regex to allow your specific numbers' range(1-19) and add that validation on TextField's TextFormatter's filter . Regex => ([1-9]|1[0-9]) [1-9] Either TextField

Limit TextField to a specific range of number JavaFX?

Deadly 提交于 2021-02-17 05:13:11
问题 Hi I need to limit the input of TextField javaFX not only for integer but also for numbers between 1 - 19 only.For example I should be allowed to type : "3" ,"19" ... but not: "33" , 44 .. for example : What is the recommended way to make a numeric TextField in JavaFX? but this limits the text field just for integers. 回答1: You can use regex to allow your specific numbers' range(1-19) and add that validation on TextField's TextFormatter's filter . Regex => ([1-9]|1[0-9]) [1-9] Either TextField

JavaFX & Spring Boot - NPE

血红的双手。 提交于 2021-02-17 04:53:45
问题 I'm still fighting with my issue. I want to use Spring Framework in order to incject dependencies and I have to use Spring boot to integrate both. Unfortunately, in first view autowiring is run correctly, but if I go next Stage, I got still only Null Pointer Exception . Thats main class: @SpringBootApplication(scanBasePackages = "boxingchallenge") public class BoxingChallengeApplication extends Application { public ConfigurableApplicationContext springContext; private Parent root; public

ConcurrentModificationException while using Iterator<Node> [duplicate]

≡放荡痞女 提交于 2021-02-17 03:29:32
问题 This question already has answers here : Concurrent Modification Exception : adding to an ArrayList (10 answers) Closed 7 months ago . I was trying to delete a row of JavaFX GridPane with JavaFX Rectangles and I found no way to do so but copying the squares above to one row below . Here is my code to do that but it keeps throwing ConcurrentModificationAcception . static void copyAbove(int rowToBeDisappear, GridPane mainGrid) { for (int y = (rowToBeDisappear-1); 0 <= y ; y--) { for (int x = 0;

Using a resource folder to load images on JavaFX project using IntelIiJ

拜拜、爱过 提交于 2021-02-16 21:07:34
问题 I'm trying to load an image to a JavaFX project. I'm doing it by calling the absolute path Users/user/Desktop/nfc.png . Is there any way to create a resource folder inside the project and calling from it the image? Below is my code: package sample; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.stage.Stage; import java.awt.Taskbar; import java.awt.image.BufferedImage;

Using a resource folder to load images on JavaFX project using IntelIiJ

浪子不回头ぞ 提交于 2021-02-16 21:07:28
问题 I'm trying to load an image to a JavaFX project. I'm doing it by calling the absolute path Users/user/Desktop/nfc.png . Is there any way to create a resource folder inside the project and calling from it the image? Below is my code: package sample; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.stage.Stage; import java.awt.Taskbar; import java.awt.image.BufferedImage;

JavaFX 11 uneditable ComboBox not displaying values outside combo items list properly

…衆ロ難τιáo~ 提交于 2021-02-16 20:13:08
问题 I have troubles with JaxaFX 11 ComboBox (it seems that in JavaFX 8 it works OK). For uneditable combo, i.e. displaying the selected value in buttoncell (not in editable textbox), no value is displayed (buttoncell probably considered "empty"), if the new value is not included in the combo's items list , with one exception only: If the previous value is null (I e.g. deselect the previous non null value by keyboard in popup list), the new non null value is displayed correctly. See a simple code

Aligning the X axes of several XYCharts

谁都会走 提交于 2021-02-16 18:31:51
问题 I have two XYChart s that I want to display vertically aligned. The two graphs share the same x axis, but they use different data sets, which values are not of the same order of magnitude. This makes the y axis labels quite different in size. In the end, the two x axes are not aligned anymore. My objective is to align those x axes. One proposed solution offers a workaround by rotating the y axis labels, making the label width identical. While this works (and I thank the contributor for his