javafx-2

Context menu insight JavaFX Task

拥有回忆 提交于 2019-12-24 20:36:57
问题 I have a problem with Context menu. Following this topic I found that there is a limitation when I try to load Context menu insight JavaFX Task. I tested to implement Platform.RunLater() but without any success. static ContextMenu contextMenuPanel; public static BorderPane stageContextMenu(BorderPane bp) { Platform.runLater(new Runnable() { @Override public void run() { contextMenuPanel = new ContextMenu(); } }); MenuItem item1 = new MenuItem("About"); item1.setOnAction(new EventHandler

Errors when trying to use JFXPasswordField Jfoenix JAVA

与世无争的帅哥 提交于 2019-12-24 20:32:58
问题 I'm trying to create some GUI with Jfoenix and I'm getting following errors when i run them. I'm not understanding the errors and i have spent the whole day please guide me. <?xml version="1.0" encoding="UTF-8"?> <?import com.jfoenix.controls.JFXPasswordField?> <?import com.jfoenix.controls.JFXTextField?> <?import javafx.scene.layout.AnchorPane?> <AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="700.0" style="-fx-background-color: #20120F;" xmlns="http://javafx.com/javafx/9" xmlns:fx=

How to hide full screen button of Mac OS window (in JavaFX)?

风流意气都作罢 提交于 2019-12-24 19:28:58
问题 Every window title bar of Mac OS has a full screen button at the top-right corner.Is there any way to hide this default full screen button of Mac OS in JavaFX? Here is my code snippet: public static void launchOkMessageBox(){ pane = new VBox(); scene = new Scene(pane,150,60, Color.GHOSTWHITE); Label label = new Label("Hello Word"); Button okButton = new Button("Ok"); pane.getChildren().add(label); pane.getChildren().add(okButton); pane.setAlignment(Pos.CENTER); pane.setSpacing(10);

Nodes - Choose the Layer to appear JavaFX2

和自甴很熟 提交于 2019-12-24 17:08:42
问题 I want to be able to choose the layer that the Nodes appear and change it throughout the course of the program. I know that the last added Nodes appear on the top of the previous one. In swing, I use JLayeredPane and its method setLayout(JComponent, integer). The higher the int, the higher level the component appears on screen. Is there something similar? Thank you 回答1: I think you can play with the z-order indices of child nodes by combinations of Node node = pane.getChildren().get(index);

How can I get the keyboard Caps Lock state in javafx

烈酒焚心 提交于 2019-12-24 17:01:34
问题 In my project, how to keyboard caps lock on state. i have refer this question How can I get the Caps Lock state, and set it to on, if it isn't already?. but i am get solution in javafx. please give me solution.I am also ref for this site https://community.oracle.com/thread/2415027?tstart=0 回答1: You will want this import: import java.awt.Toolkit; If you are wanting it on no matter what, just turn it on with: Toolkit.getDefaultToolkit().setLockingKeyState(KeyEvent.VK_CAPS_LOCK, true); If you

Closing a substage

故事扮演 提交于 2019-12-24 15:14:49
问题 What I'm trying to do I think is exactly what Meg is talking about here: JavaFX2 : Closing a stage (substage) from within itself When I try to implement JewelSea's answer I get the "nonstatic method getSource() cannot be referenced from a static context." So I have my secondary window (scene) created in Scene Builder with a simple controller class that has basically one function: tie the button to a close() event handler. Here's the code I have: public class ProductNotFoundController

How to pass JVM arguments to a native JavaFX 2 application created with Inno Setup

白昼怎懂夜的黑 提交于 2019-12-24 15:06:14
问题 I have a JavaFX 2 desktop application. I've used javafx-maven-plugin and Inno Setup to create a native bundle for Windows (.exe installer). When I install the application on Windows Server 2008, I get an out of memory exception, because of the low heap size. How can I pass JVM arguments to increase the heap size (-Xmx) in this scenario? Is there any way to specefy jvm arguments to be called when creating the native bundle with Inno Setup? 回答1: There is no way to do in via Inno Setup, because

JavaFX FXML table; why won't my data display

我的未来我决定 提交于 2019-12-24 14:42:49
问题 I'm trying to create a simple table using FXML. The table displays fine, but it's not displaying my data. Here's my main program. public final class TableTest extends Application { @Override public void start(final Stage primaryStage) { URL fxml = ClassLoader.getSystemClassLoader().getResource("Table.fxml"); FXMLLoader fxmlLoader = new FXMLLoader(fxml); TableController tableController = new TableController(); fxmlLoader.setController(tableController); try { Pane rootPane = (Pane) fxmlLoader

TextArea setScrollTop

喜你入骨 提交于 2019-12-24 13:52:08
问题 I created this simple example of TextArea import javafx.application.Application; import static javafx.application.Application.launch; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.TextArea; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class MainApp extends Application { @Override public void start(Stage stage) throws Exception { HBox hbox = new HBox(); // Text Area TextArea dataPane = new TextArea();

JavaFx 2.x: How to draw minor grid lines

拈花ヽ惹草 提交于 2019-12-24 13:35:14
问题 I'm unable to draw minor grid lines, it is possible to do so in JavaFx 2.2? In my case the grid and the graph moves so I cannot use a static image to generate the minor grid (live graph as shown in this example here). Currently I see this an example of what I'm looking for. 回答1: As suggested by @colti and a little bit of module logic I came up with this solution import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.chart.LineChart; import javafx.scene.chart