Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <?import java.lang.*?>
- <?import java.util.*?>
- <?import javafx.scene.*?>
- <?import javafx.scene.control.*?>
- <?import javafx.scene.layout.*?>
- <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="320.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Test">
- <children>
- <Button id="btnbuy" fx:id="btnbuy" layoutX="134.0" layoutY="2.0" mnemonicParsing="false" onAction="#loadSecondFxml" text="Purchase" />
- <Button id="btnSell" fx:id="btnsell" layoutX="140.0" layoutY="454.0" mnemonicParsing="false" text="Sell" />
- </children>
- </AnchorPane>
- <?xml version="1.0" encoding="UTF-8"?>
- <?import java.lang.*?>
- <?import java.util.*?>
- <?import javafx.scene.*?>
- <?import javafx.scene.control.*?>
- <?import javafx.scene.layout.*?>
- <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="320.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Test">
- <children>
- <Pane layoutX="6.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="320.0">
- <children>
- <Label layoutX="146.0" layoutY="232.0" text="You got here" />
- </children></Pane>
- </children>
- </AnchorPane>
- import javafx.application.Application;
- import javafx.fxml.FXMLLoader;
- import javafx.scene.Parent;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.stage.Stage;
- public class Test extends Application {
- private MainPage parentForm;
- //private Panel panel;
- public Button btnbuy;
- public Button btnsell;
- public Test(){
- }
- public void start(Stage primaryStage) throws Exception{
- Parent root = FXMLLoader.load(getClass().getResource("Index.fxml"));
- primaryStage.setTitle("Hello World");
- primaryStage.setScene(new Scene(root, 320, 480));
- primaryStage.show();
- }
- public void loadSecondFxml() throws Exception{
- Stage primaryStage = new Stage();
- Parent root = FXMLLoader.load(getClass().getResource("MainPage.fxml"));
- primaryStage.setTitle("Hi");
- primaryStage.setScene(new Scene(root, 320, 480));
- primaryStage.show();
- }
- public static void main(String args[]){
- launch(args);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement