fxml

Java FX changing value of Label from different scene

蓝咒 提交于 2019-12-02 02:53:27
I have two scenes. The first scene invokes second scene using the following code. @FXML private void confirmation(ActionEvent event) throws IOException{ Stage confirmation_stage; Parent confirmation; confirmation_stage=new Stage(); confirmation=FXMLLoader.load(getClass().getResource("Confirmation.fxml")); confirmation_stage.setScene(new Scene(confirmation)); confirmation_stage.initOwner(generate_button.getScene().getWindow()); confirmation_stage.show(); } There is a label in "Confirmation.fxml" called "Proceed". I need to change the content of that label from within this function and return

Block parent stage until child stage closes

社会主义新天地 提交于 2019-12-02 00:43:44
I have a controller on which an action event of my button opens a child stage. The issue is when I close the parent stage, the child stage also closes. I want to prevent parent stage from closing as long as child stage is open. URL url = getClass().getResource("Message.fxml"); FXMLLoader fxmlLoader = new FXMLLoader(); fxmlLoader.setLocation(url); fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory()); root = (Parent)fxmlLoader.load(url.openStream()); Stage stage = new Stage(); //stage.initStyle(StageStyle.UNDECORATED); //stage.setFullScreen(true); stage.setTitle("Welcome User"); stage

JavaFX 2.0 loading fxml files with event handlers fails

↘锁芯ラ 提交于 2019-12-01 23:38:41
i am trying to load a fxml from a subfolder, but it fails. I have the line that make the replace scene content: private Parent replaceSceneContent(String fxml) throws Exception { Parent page = (Parent) FXMLLoader.load(App.class.getResource("skinFolder/fxml/"+fxml), null, new JavaFXBuilderFactory()); Scene scene = stage.getScene(); if (scene == null) { scene = new Scene(page, 700, 450); scene.getStylesheets().add(App.class.getResource("skinFolder/css/defaultSkin.css").toExternalForm()); stage.setScene(scene); } else { stage.getScene().setRoot(page); } stage.sizeToScene(); return page; } I use

Creating a large body of text with different styles - JavaFX FXML

痴心易碎 提交于 2019-12-01 18:37:31
In the fxml class of my JavaFx application I want to add a large body of text using minimal components (instead of adding multiple labels per line). I would also like to create varying styles of text in the same component. What component should I use (e.g TextArea) and how would I go about create multiple styles inside it (using css). Use a TextFlow and add Text to it. You can style individual Text component with different style using css on them. Complete example : import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.text.Text; import javafx.scene.text

How to Convert FXML to JAVA

会有一股神秘感。 提交于 2019-12-01 18:29:28
I were created a fxml file using javafx scene builder in netbeans. How do i convert .fxml file in netbeans to .java? Is that any program to convert it? I am not very good in fxml so I want to use .java file to code my javafx app. Please help me. Thank tomsontom There isn't any support for this kind of thing. The idea is that you are using FXML to visually layout your UI and then connecting it to java using a controller class. Sidenote: We at e(fx)clipse started a build addon that allows you to converter FXML-Files into Java-Files - because of performance reasons on embedded devices. Is that

Running javafx app with hibernate takes too much time

孤街浪徒 提交于 2019-12-01 14:49:53
I am working on javafx 2.0 using netbeans 7.4 and hibernate.. the issue was that i am run application its build all jar and take too much time to run.. how can i get run fast... SessionFactory sess = new Configuration().configure().buildSessionFactory(); Session ses = sess.openSession(); Query qry = ses.createQuery("select count(*) from UserDo"); Iterator it =qry.iterate(); jewelsea NetBeans build time improvement suggestions It seems that likely your issue is not the time taken to run the application, but more the time taken to build it using your current build settings in NetBeans. Here are

FXML Variables not binding

一笑奈何 提交于 2019-12-01 14:47:23
I am having an issue with my FXML injection. I have setup my program as far as I can tell but it seems that I am missing something. My code is below: Main: package application; import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.layout.BorderPane; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; public class Main extends Application { @Override public void start(Stage primaryStage) { try { FXMLLoader loader = new FXMLLoader(getClass().getResource("NoteKeeper.fxml")); BorderPane root = (BorderPane)loader.load(); Scene scene =

Creating a row index column in JavaFX

女生的网名这么多〃 提交于 2019-12-01 13:59:43
I have a JavaFX TableView that I'm populating with an ObservableList of Tasks. I've been trying to create a column that displays the index of each row, which serves as the ID for the tasks in the table, but I've tried the method here and similar methods from other sources with little success. My code for reference, which has no superficial errors (as far as Eclipse can tell): @FXML private TableColumn<Task, String> taskIndexCol; Callback<TableColumn<Task, String>, TableCell<Task, String>> cb = new Callback<TableColumn<Task, String>, TableCell<Task, String>>(){ @Override public TableCell<Task,

imageview in tableview. JavaFX. Cant explain what is this?

你。 提交于 2019-12-01 13:58:35
This is code mainController for my fxml form. Image in tableview work, but some strangeable. Add first row - ok. Add second: watch image in second from the start and first from the end. Add third: watching in third row from the start and fourth from the end... etc.. What is this? data no add in those rows, but image adding. Where is problem? package cardiler; import java.io.IOException; import java.net.URL; import java.util.ResourceBundle; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx

Running javafx app with hibernate takes too much time

亡梦爱人 提交于 2019-12-01 13:30:12
问题 I am working on javafx 2.0 using netbeans 7.4 and hibernate.. the issue was that i am run application its build all jar and take too much time to run.. how can i get run fast... SessionFactory sess = new Configuration().configure().buildSessionFactory(); Session ses = sess.openSession(); Query qry = ses.createQuery("select count(*) from UserDo"); Iterator it =qry.iterate(); 回答1: NetBeans build time improvement suggestions It seems that likely your issue is not the time taken to run the