javafx-8

JavaFX Application with Maven in Eclipse

 ̄綄美尐妖づ 提交于 2019-11-30 15:15:29
问题 I want to ask if there is any method to add JavaFX into Maven Archetype list in Eclipse or any plugin to use Maven to build JavaFX Application. 回答1: There is the javafx-maven-plugin which is available for maven. When developing with Java 8 you just put that plugin as some build-plugin, without further dependencies. <plugin> <groupId>com.zenjava</groupId> <artifactId>javafx-maven-plugin</artifactId> <version>8.8.3</version> <configuration> <mainClass>your.main.class.which.extends.javafx

Javafx resize components when fullscreen

狂风中的少年 提交于 2019-11-30 15:08:10
Original size screenshot Fullscreen screenshot When i resize how can i nicely arrange the components. im using FXML for the GUI FXML CODE <AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="style.LoginController"> <children> <Button fx:id="login" layoutX="250.0" layoutY="242.0" mnemonicParsing="false" onAction="#login" prefHeight="32.0" prefWidth="101.0" text="Login" /> <ImageView fx:id="img2" fitHeight="32.0" fitWidth="32.0" layoutX="109.0" layoutY="184.0" pickOnBounds="true" preserveRatio="true

Get key combination code

浪尽此生 提交于 2019-11-30 14:19:53
I want to ask you can I get key code combination of multiple keys. For example I can get the key code from this example: public void handle(KeyEvent event) { if (event.getCode() == KeyCode.TAB) { } But how I can get the key code of this example: textField.setText(""); // Process only desired key types if (event.getCode().isLetterKey() || event.getCode().isDigitKey() || event.getCode().isFunctionKey()) { String shortcut = event.getCode().getName(); if (event.isAltDown()) { shortcut = "Alt + " + shortcut; } if (event.isControlDown()) { shortcut = "Ctrl + " + shortcut; } if (event.isShiftDown())

JavaFX Application with Maven in Eclipse

試著忘記壹切 提交于 2019-11-30 13:31:52
I want to ask if there is any method to add JavaFX into Maven Archetype list in Eclipse or any plugin to use Maven to build JavaFX Application. There is the javafx-maven-plugin which is available for maven. When developing with Java 8 you just put that plugin as some build-plugin, without further dependencies. <plugin> <groupId>com.zenjava</groupId> <artifactId>javafx-maven-plugin</artifactId> <version>8.8.3</version> <configuration> <mainClass>your.main.class.which.extends.javafx.Application</mainClass> </configuration> </plugin> Calling mvn jfx:jar creates your javafx-application-jar inside

Choose which monitor does a JavaFX window open in

ぐ巨炮叔叔 提交于 2019-11-30 13:02:46
I have two monitors. I have Eclipse open on the second monitor but when I run my JavaFX code, the JavaFX window always opens up in the first monitor and every time I have to drag it to the second monitor to use it. I have to do this because when it opens on the first monitor, none of the components inside the scene are loaded. It gets loaded only if I drag it to the second monitor. But when I disconnect the second monitor, it loads properly. Can someone please help me out? How do I, by default, make the window to open on the second monitor? NB: My first monitor is a Macbook Pro and the second

JavaFx 8: open a link in a browser without reference to Application

天大地大妈咪最大 提交于 2019-11-30 12:09:20
Have got a Hyperlink. When clicked I want a link to be opened in an external browser. The usual method cited on the web seems to be: final Hyperlink hyperlink = new Hyperlink("http://www.google.com"); hyperlink.setOnAction(t -> { application.getHostServices().showDocument(hyperlink.getText()); }); However I don't have a reference to Application . The link is opened from Dialog, which is opened from a Controller, which is opened via an fxml file, so getting a reference to the Application object would be quite painful. Does anyone know an easy way of doing this? Cheers Solution 1: Pass a

ICON set for JavaFX application is visible in Windows but not in Ubuntu

给你一囗甜甜゛ 提交于 2019-11-30 11:44:06
It is a bit weird or maybe there is something wrong with my code. I am setting JavaFX application ICON which is very well visible on Windows system but not on Ubuntu. On Windows: On Ubuntu: Any idea about the reason behind this. Code Sample: @Override public void start(Stage stage) throws Exception { try { setUserAgentStylesheet(STYLESHEET_MODENA); FXMLLoader loader = new FXMLLoader(); Parent root = (Parent) loader.load(getClass().getResourceAsStream("ui/ParentWindow.fxml")); final ParentWindowController controller = (ParentWindowController) loader.getController(); stage.addEventHandler

How to resolve nested column in tableview after update version of java-124 in javaFx?

孤者浪人 提交于 2019-11-30 10:23:21
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at com.sun.javafx.scene.control.skin.NestedTableColum nHeader.dispose(NestedTableColumnHeader.java:323) at com.sun.javafx.scene.control.skin.NestedTableColum nHeader.updateTableColumnHeaders(NestedTableColumn Header.java:265) at com.sun.javafx.scene.control.skin.NestedTableColum nHeader.checkState(NestedTableColumnHeader.java:51 9) at com.sun.javafx.scene.control.skin.NestedTableColum nHeader.computePrefHeight(NestedTableColumnHeader. java:401) at javafx.scene.Parent.prefHeight(Parent.java:918) at javafx.scene

How to access the Scrollbars of a ScrollPane

元气小坏坏 提交于 2019-11-30 09:59:15
I'm trying to get some information about the ScrollBar components that are by standard included in a ScrollPane . Especially i'm interested in reading the height of the horizontal Scrollbar . How can i reference it? Since the mentioned methods did not work for everybody (including me), I investigated it a bit more and found the source of the problem. In general, both methods work, but only as soon as the ScrollPane 's skin property has been set. In my case, skin was still null after loading my view using FXMLLoader . By delaying the call in case the skin property has not been initialized

Display Combobox values from numbers

馋奶兔 提交于 2019-11-30 09:56:36
问题 I have a int value which I want to use for configuration. It can have 2 values - 0 for active and 1 for Blocked. I want to display this into friendly combo box: import javafx.application.Application; import static javafx.application.Application.launch; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.Scene; import javafx.scene.control.ComboBox; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; public class MainApp extends