Advertisement
Guest User

Untitled

a guest
May 24th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. import javafx.application.Application;
  2. import javafx.fxml.FXMLLoader;
  3. import javafx.scene.Parent;
  4. import javafx.scene.Scene;
  5. import javafx.stage.Stage;
  6. public class FXMLExample extends Application{
  7. @Override
  8. public void start(Stage stage) throws Exception {
  9. Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
  10. Scene scene = new Scene(root, 300, 275);
  11. stage.setTitle("FXML Welcome");
  12. stage.setScene(scene);
  13. stage.show();
  14. }
  15. public static void main(String[] args) {
  16. launch(args);
  17. }
  18. }
  19.  
  20. <GridPane xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10">
  21. <padding>
  22. <Insets top="25" right="25" bottom="10" left="25" />
  23. </padding>
  24. <Text id="welcome-text" text="Welcome" GridPane.columnIndex="0"
  25. GridPane.rowIndex="0" GridPane.columnSpan="2" />
  26.  
  27. <Label text="User Name:" GridPane.columnIndex="0"
  28. GridPane.rowIndex="1" />
  29.  
  30. <TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
  31.  
  32. <Label text="Password:" GridPane.columnIndex="0"
  33. GridPane.rowIndex="2" />
  34.  
  35. <PasswordField GridPane.columnIndex="1"
  36. GridPane.rowIndex="2" />
  37.  
  38. <HBox spacing="10" alignment="bottom_right" GridPane.columnIndex="1"
  39. GridPane.rowIndex="4">
  40. <Button text="Sign In"/>
  41. </HBox>
  42.  
  43. <Text fx:id="actiontarget" GridPane.columnIndex="0"
  44. GridPane.columnSpan="2" GridPane.halignment="RIGHT" GridPane.rowIndex="6" />
  45.  
  46. </GridPane>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement