Is it possible in javafx to open new stages (windows) from another fxml with a button? Thanks for the answers.
Javafx open another fxml in the another window with button
79k views Asked by Sevi At
2
There are 2 answers
0
Sevi
On
I had to modify the code a bit and it works fine. Thank you again for the code!
public void pressButton(ActionEvent event) throws Exception {
try {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/A.fxml"));
Parent root1 = (Parent) fxmlLoader.load();
Stage stage = new Stage();
stage.setScene(new Scene(root1));
stage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
Related Questions in JAVAFX
- Function for making the code wait in javafx
- JavaFX build generating a blank gui with primary view and secondary view buttons
- JavaFX SwingNode instantiation fails with exception
- I want to understand modularity in java. When compiling my app I have a ResolutionException
- Importing Jython into a JavaFX application
- gluon attach audio doesn't play any sound on android
- Using javaFx, how to distinguish between return-key and enter-key on the numpad?
- Displaying a Hashmap in a TableView in JavaFX
- HBox doesn't fill parent GridPane when rotated by 90 degrees
- Run java program
- Setting up MongoDB with JavaFX in Intellij, MongoDB external Jar files throwing errors
- JavaFX not support GPU hardware decoding?
- JavaFX resize ImageView in center of BorderPane
- In Javafx how to access object of a component which is under an overridden method? Problem related with TableView
- How to style rounded corners of a TextArea in JavaFX
Related Questions in WINDOW
- Pycharm doesn't show "executable_path" and I got this error and no idea what to do
- Join statement with nested select
- Are there any tools or NuGet packages available for C# (Windows Forms) that assist in visualizing Dijkstra's algorithm?
- paho mqtt java cannot reconnect after a long time machine sleep
- An issue where memory peaks abnormally and then normalizes again
- Writing large buffer data to a file using Windows API
- Pyspark Cummularive Sum Window Date and Sequence Number
- Get value from new popup window by clicking on an element using Jquery
- How will create the updater & repair window's in NSIS using NULL SCRIPT
- window.localStorage function not working on API Routing NextJS
- Is there any way to make tkinter window dismiss Win + D command?
- How to get JSON data from an external window in javaScript(different domains)
- Overriding the default export button click event in crystal report viewer Print UI fdialog
- Is there a way using JavaScript to open a new window in another monitor?
- Unable docker desktop with Window 10 Pro
Related Questions in FXML
- e(fx)clipse how to disable Warning "JavaFX controller method must have 0 or exactly 1 argument"
- FXML BorderPane size not changing despite using setMinSize() and setPrefSize() in JavaFX application
- JavaFX Charts - NoSuchMethodError on flatMap when trying to add data to a LineChart
- JavaFX scene minWidth and minHeight not working
- set perspective camera as subscene camera in fxml file
- TextArea FXML border radius
- Why does Apache NetBeans Null Pointer Exception give me an error in my Java FXML project?
- How to properly inherit an FXML annotated attribute for having it available in a subclass?
- FXMl File is always null in Intellij
- How to grow layouts in Javafx vertically as the height of screen increases?
- How can I update a text value of Label in non-controller class of Javafx?
- How do I handle multiple button in javafx
- Why does my javaFX field reset in every keyframe?
- File not found issue JAVAFX
- How to save an image snapshot of a Pane as a BMP?
Related Questions in STAGE
- How to make MouseTransparent Stage in JavaFX
- Azure DevOps release stages is there a limit of how many stages you can have?
- Jenkins Post actions fails but stage not marked in red
- I have a pipeline in Jenkins that have 14 stages, and I want to POST the duration, the result and the name of each stage into Graylog. How can I do?
- Using libGdx, nothing is shown after calling stage.draw() which stage has extendViewport
- show parameters in the log DataStage Cloud
- Snowflake stage gives: SQL compilation error: Option SNAPPY_COMPRESSION is not valid for file format type PARQUET
- How to access the stage in another class?
- IBM DataStage - unstructured data stage imports NULL from excel cells that contain formulas
- Dynamic generation of parallel stages in jenkins
- Snowflake error 000002 (0A000): Unsupported feature 'unsupported_requested_format:snowflake' while loading file into local storage using get command
- Snnowflake - COPY statement only supports simple SELECT from stage statements for import
- Exploring Data loaded to an internal stage in snowflake
- why commit records local file without staging it?
- not able to create stage in snowflake
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Use the code below on button click: