Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <?import java.lang.*?>
  4. <?import java.util.*?>
  5. <?import javafx.scene.*?>
  6. <?import javafx.scene.control.*?>
  7. <?import javafx.scene.layout.*?>
  8.  
  9. <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">
  10. <children>
  11. <Button id="btnbuy" fx:id="btnbuy" layoutX="134.0" layoutY="2.0" mnemonicParsing="false" onAction="#loadSecondFxml" text="Purchase" />
  12. <Button id="btnSell" fx:id="btnsell" layoutX="140.0" layoutY="454.0" mnemonicParsing="false" text="Sell" />
  13. </children>
  14. </AnchorPane>
  15.  
  16. <?xml version="1.0" encoding="UTF-8"?>
  17.  
  18. <?import java.lang.*?>
  19. <?import java.util.*?>
  20. <?import javafx.scene.*?>
  21. <?import javafx.scene.control.*?>
  22. <?import javafx.scene.layout.*?>
  23.  
  24. <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">
  25. <children>
  26. <Pane layoutX="6.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="320.0">
  27. <children>
  28. <Label layoutX="146.0" layoutY="232.0" text="You got here" />
  29. </children></Pane>
  30. </children>
  31. </AnchorPane>
  32.  
  33. import javafx.application.Application;
  34. import javafx.fxml.FXMLLoader;
  35. import javafx.scene.Parent;
  36. import javafx.scene.Scene;
  37. import javafx.scene.control.Button;
  38. import javafx.stage.Stage;
  39.  
  40. public class Test extends Application {
  41. private MainPage parentForm;
  42. //private Panel panel;
  43. public Button btnbuy;
  44. public Button btnsell;
  45.  
  46. public Test(){
  47. }
  48. public void start(Stage primaryStage) throws Exception{
  49. Parent root = FXMLLoader.load(getClass().getResource("Index.fxml"));
  50. primaryStage.setTitle("Hello World");
  51. primaryStage.setScene(new Scene(root, 320, 480));
  52. primaryStage.show();
  53. }
  54. public void loadSecondFxml() throws Exception{
  55. Stage primaryStage = new Stage();
  56. Parent root = FXMLLoader.load(getClass().getResource("MainPage.fxml"));
  57. primaryStage.setTitle("Hi");
  58. primaryStage.setScene(new Scene(root, 320, 480));
  59. primaryStage.show();
  60. }
  61.  
  62. public static void main(String args[]){
  63. launch(args);
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement