javafx-8

JavaFx: ComboBox Table Cell double click

送分小仙女□ 提交于 2021-02-10 10:22:50
问题 The problem is the following: I have a TableView with ComboBoxes where for every TableCell I can select a value from the comboboxes. The problem is, if I have a lot of rows and columns I have to click a lot to select the appropriate value in every comboBox. To select a value in a combobox I have to click four times to select the value. Once to select the cell, once to set the graphics the comboBox, again to open the popup for the combobox where I can select the value and finally to select the

Javafx font derive bold

99封情书 提交于 2021-02-10 05:21:07
问题 I wanted to change a (loaded) text font dinamically for my javafx application, so I did this code: Font font = Font.loadFont(Fonts.class.getClassLoader().getResource("path/font.woff").toExternalForm(), 25); Font bold = Font.font(font.getFamily(), FontWeight.BOLD, font.getSize()); Font italic = Font.font(font.getFamily(), FontPosture.ITALIC, font.getSize()); Font boldItalic = Font.font(font.getFamily(), FontWeight.BOLD, FontPosture.ITALIC, font.getSize()); but when I try to change the text

JavaFX does not work with IntelliJ (jdk 9)

≯℡__Kan透↙ 提交于 2021-02-08 08:12:50
问题 JavaFX is not working for me using IntelliJ. While it does compile, I get an Exception when trying to launch. I've found similar issues here, none of which seemed to hold an answer to my problem. The Exception I get is the following: Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java

'Toolkit not initialized' exception when unit-testing an JavaFX application

会有一股神秘感。 提交于 2021-02-07 20:36:19
问题 When I try to perform unit tests on components which contain JavaFX controls I get a java.lang.IllegalStateException: Toolkit not initialized . How can components be unit tested which operate with JavaFX controls? 回答1: Add the following dependency to your project <dependency> <groupId>de.saxsys</groupId> <artifactId>jfx-testrunner</artifactId> <version>1.2</version> </dependency> and the following annotation to your test classes @RunWith(JfxRunner.class) 回答2: Just declare and initialize a JFX

'Toolkit not initialized' exception when unit-testing an JavaFX application

浪尽此生 提交于 2021-02-07 20:35:04
问题 When I try to perform unit tests on components which contain JavaFX controls I get a java.lang.IllegalStateException: Toolkit not initialized . How can components be unit tested which operate with JavaFX controls? 回答1: Add the following dependency to your project <dependency> <groupId>de.saxsys</groupId> <artifactId>jfx-testrunner</artifactId> <version>1.2</version> </dependency> and the following annotation to your test classes @RunWith(JfxRunner.class) 回答2: Just declare and initialize a JFX

Editing large text files with JavaFX using TextArea

不羁岁月 提交于 2021-02-07 19:47:57
问题 Is there a way to make editing a relatively large text file (ex. 10-25 MB) in a TextArea reasonably fast? Or maybe there are features that can be disabled to make it faster? Is there an alternative component? (I know about RichTextFX, but I imagine it'd be slower since it does more, and I only need a basic editor.) I'd rather not break the source text up into smaller parts and only load a portion of the text, since that would break text selection+copy (ie. "select all" would only be selecting

Editing large text files with JavaFX using TextArea

送分小仙女□ 提交于 2021-02-07 19:47:34
问题 Is there a way to make editing a relatively large text file (ex. 10-25 MB) in a TextArea reasonably fast? Or maybe there are features that can be disabled to make it faster? Is there an alternative component? (I know about RichTextFX, but I imagine it'd be slower since it does more, and I only need a basic editor.) I'd rather not break the source text up into smaller parts and only load a portion of the text, since that would break text selection+copy (ie. "select all" would only be selecting

Missing JavaFX application class

拥有回忆 提交于 2021-02-07 14:21:07
问题 I have java code like this: package mypackage; import javafx.application.Application; import javafx.stage.Stage; public class MyApp extends Application{ public static void main(String args[]){ launch(args); } public void start(Stage primaryStage){ primaryStage.show(); } } and I've compiled it at ~/myjava/src/mypackage/MyApp.class . then, when I'm running from ~$ java -cp myjava/src mypackage/MyApp why getting error like: Missing JavaFX application class mypackage/MyApp I'm using JDK 8. 回答1:

Javafx combobox not updating dropdown size upon change on realtime?

淺唱寂寞╮ 提交于 2021-02-06 11:33:53
问题 I am using Javafx v8.0.25-b18. The problem I occur is that the size of the dynamic combox's dropdown list doesn't change, so if I had initially two items in the dropdown, then the dropdown size will be good for two items, but if I now populate the dynamic combox with three items then I get a small scrollbar inside!?, If I remove an item - I will have a blank space in the combox !? I want to "reset" the dropdown size each time I put values into it, so it will be the right size each time it

JavaFX - How to create SnapShot/Screenshot of (invisble) WebView

好久不见. 提交于 2021-02-06 10:24:29
问题 I want to create a SnapShot/Screenshot/Image from a WebView in JavaFX(8). This WebView does not need to be visible (in my case). My question: Is it possible (in any way), to create a Screenshot/Image from a WebView, when the WebView is not visible (or not added to any visible container) ? See my example code, when WebView (or it's parent ScrollPane) is visible=false , the Screenshot won't work (respectively is emtpy/blank ). Example code: package test; import javafx.animation.KeyFrame; import