javafx-8

What is JavaFX equivalent of JSyntaxPane for making a code editor?

ぐ巨炮叔叔 提交于 2019-12-03 07:09:22
Previously in Swing, I have used the JSyntaxPane for making a tiny Java source editor. For practice, I decided to redo the entire project in JavaFX and adding support for more languages. Preferably, as many as I can. However, there seems to be nothing similar to JSyntaxPane . A bit of research led me to Tom Schindl 's blog where he has made a source code viewer with proper syntax highlighting. No editing support, sadly. Then there is JewelSea 's blog but from the screenshot it look's like SO's type-and-preview method. Not something desired in a code editor. Again, from JFXperience I found that

Scala using Java libraries, taking advantage of lambda expressions support in Java 8

老子叫甜甜 提交于 2019-12-03 05:48:57
问题 According to: http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#lambda-expressions-in-gui-applications Previously: btn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { System.out.println("Hello World!"); } }); Now, we can: btn.setOnAction( event -> System.out.println("Hello World!") ); Now, I try to do that in Scala when using a Java library. I'm using JavaFX (which is included by default in Java 1.8 SE). Try: chart

JavaFX8: How to create listener for selection of row in Tableview?

和自甴很熟 提交于 2019-12-03 05:40:35
问题 I currently have two tableviews in one screen, which results in both TableViews have rows which the user can select. Now I want only one row to be selected at the same time (doesn't matter which TableView it is selected from). I was thinking about some kind of listener which deselects the other row when a row is selected. This is my initial setup: Step 1 Search for a way to bind a method to the selection of a row (there is not something like tableview.setOnRowSelected(method) ) Step 2 Create

Issue with background color in JavaFX 8

天涯浪子 提交于 2019-12-03 05:22:35
Looks like there is an issue with setting background colors for panels in JavaFX 8. I had been trying the below, but none of them set the appropriate background colors. VBox panel = new VBox(); panel.setAlignment(Pos.TOP_LEFT); // None of the below work panel.setStyle("-fx-background-color: #FFFFFF;"); panel.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY))); Is there something wrong in the way I am setting the background color? This used to work with earlier versions of JavaFX 2.2. Thanks. Both these work for me. Maybe post a complete example?

Using JavaFX controller without FXML

淺唱寂寞╮ 提交于 2019-12-03 04:03:19
Is there a possibility to use a controller with a JavaFX GUI without using FXML. I noticed that the FXML file contains an fx-controller attribute to bind the controller but i don't find it an easy way to work with it. Any ideas about have an MVC arch with JavaFX without using the FXML file or JavaFX Scene Builder ? Your question isn't particularly clear to me: you just create the classes and basically tie everything together with listeners. I don't know if this helps, but here is a simple example that just has a couple of text fields and a label displaying their sum. This is what I regard as

Get screen coordinates of a node in javaFX 8

流过昼夜 提交于 2019-12-03 03:42:45
I am developing a JavaFX application on Windows 8.1 64bit with 4GB of RAM with JDK version 8u45 64bit. I want to capture part of the screen using Robot but the problem is that I can't get the screen coordinates of the anchor pane that I want to capture and I don't want to use snapshot because the output quality is bad. Here is my code. I have seen the question in this link Getting the global coordinate of a Node in JavaFX and this one get real position of a node in javaFX and I tried every answer but nothing is working, the image shows different parts of the screen. private void capturePane()

How to handle java web start (jnlp) downloading progress in a preloader?

怎甘沉沦 提交于 2019-12-03 01:12:11
Issue I have a preloader for my application that handles the Application-specific initialization. Now I'm trying to extend this so that the preloader also shows the progress of the downloaded application JARs. TL;DR Why is the preloader not getting loaded during Phase 2 , as this should handle the PreloaderFx::handleProgressNotification(); to track the downloading of the JARs I suppose? Update 14 March 2016 : Is using DownloadServiceListener the way to solve this? How to connect this to a JavaFX stage? Documentation According to Oracle , there are 4 phases when an application gets launched:

JavaFX 8 - How to build EXE with Maven & INNO

隐身守侯 提交于 2019-12-03 00:29:58
I have not been able to successfully find a working solution on how to configure Maven to build an EXE from JavaFX with Maven. Projects set up with E(fx)clipse using the build.fxbuild work great, however I would prefer to have a maven project, with dependent modules rather the basic ANT builds. I have seen some comments on ZENJAVA - but it appears that plug in has lost all traction and is pretty much dead. Is there anything out there that can bundle an EXE from Maven? My project is an enterprise project which will have several projects, and lots of dependencies - so I was hoping for a simple,

javafx how to get selected row data in table view with checkbox

时光毁灭记忆、已成空白 提交于 2019-12-02 23:51:26
问题 In this project I can't get whether the Checkbox data was selected or not in the console output. My code: import java.util.Arrays; import java.util.Iterator; import java.util.List; import javafx.application.Application; import javafx.beans.Observable; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.beans.value.ChangeListener; import

Adding Spring Dependency Injection in JavaFX (JPA Repo, Service)

人走茶凉 提交于 2019-12-02 22:22:11
问题 I have a java FX basic application which has a simple Scene(a form). I have a Mysql Db and I am using Spring JPA (spring data jpa i.e repository/entities) to interact with the same. Now, since we know that javaFx has some lifecycle hooks namely: init() start() and stop(). Let's say I want to insert data in Database using JPA save() method. Usually, if it was my controller, a normal DB injection like: @Autowired EmployeeRepo employeeRepo; Would have worked. But, I am not able to access this