Advertisement
Pihtija

OBP2 2019

Jan 15th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. package samostalni;
  2.  
  3. import javafx.application.Application;
  4. import javafx.collections.ObservableList;
  5. import javafx.scene.Node;
  6. import javafx.scene.Parent;
  7. import javafx.scene.Scene;
  8. import javafx.scene.control.Label;
  9. import javafx.scene.control.RadioButton;
  10. import javafx.scene.control.TextField;
  11. import javafx.scene.control.ToggleGroup;
  12. import javafx.scene.layout.FlowPane;
  13. import javafx.scene.layout.GridPane;
  14. import javafx.scene.layout.HBox;
  15. import javafx.scene.layout.VBox;
  16. import javafx.stage.Stage;
  17.  
  18. /**
  19. * Created by korisnik on 15.1.2019..
  20. */
  21. public class Samostalni extends Application{
  22. public static void main(String[] args) { launch(args);}
  23.  
  24.  
  25. @Override
  26. public void start (Stage primaryStage) throws Exception {
  27.  
  28. primaryStage.setTitle("Billing Information");
  29. primaryStage.setWidth(500.0);
  30. primaryStage.setHeight(700.0);
  31. Parent korenskiCvor=new GridPane();
  32. ObservableList<Node> listaCvorova=((GridPane)korenskiCvor).getChildren();
  33.  
  34.  
  35. Label l1=new Label("First Name:");
  36. ((GridPane)korenskiCvor).add(l1,0,0);
  37. Label l2=new Label("Last Name:");
  38. ((GridPane)korenskiCvor).add(l2,0,1);
  39. Label l3=new Label("Gender:");
  40. ((GridPane)korenskiCvor).add(l3,0,2);
  41. Label l4=new Label("Languages:");
  42. ((GridPane)korenskiCvor).add(l4,0,3);
  43. Label l5=new Label("Email:");
  44. ((GridPane)korenskiCvor).add(l5,0,4);
  45. Label l6=new Label("Adress:");
  46. ((GridPane)korenskiCvor).add(l6,0,5);
  47. Label l7=new Label("State:");
  48. ((GridPane)korenskiCvor).add(l7,0,6);
  49. Label l8=new Label("Zip:");
  50. ((GridPane)korenskiCvor).add(l8,0,7);
  51. Label l9=new Label("Credit Card Type:");
  52. ((GridPane)korenskiCvor).add(l9,0,8);
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. TextField tfUnos=new TextField();
  61. ((GridPane)korenskiCvor).add(tfUnos,1,0);
  62. TextField tfUnos1=new TextField();
  63. ((GridPane)korenskiCvor).add(tfUnos1,1,1);
  64.  
  65. HBox hB=new HBox(40);
  66. RadioButton rb1=new RadioButton("Muski");
  67. RadioButton rb2=new RadioButton("Zenski");
  68. hB.getChildren().addAll(rb1,rb2);
  69. ToggleGroup tgPol=new ToggleGroup();
  70. rb1.setToggleGroup(tgPol);
  71. rb2.setToggleGroup(tgPol);
  72. ((GridPane)korenskiCvor).add(hB,1,2);
  73.  
  74.  
  75. Scene scena=new Scene(korenskiCvor);
  76. primaryStage.setScene(scena);
  77. primaryStage.show();
  78. }
  79.  
  80. }
  81.  
  82.  
  83.  
  84. package glavni;
  85.  
  86. import javafx.application.Application;
  87. import javafx.collections.ObservableList;
  88. import javafx.scene.Group;
  89. import javafx.scene.Node;
  90. import javafx.scene.Parent;
  91. import javafx.scene.Scene;
  92. import javafx.scene.control.*;
  93. import javafx.scene.control.Label;
  94. import javafx.scene.control.TextField;
  95. import javafx.scene.layout.FlowPane;
  96. import javafx.scene.layout.GridPane;
  97. import javafx.scene.layout.HBox;
  98. import javafx.scene.layout.VBox;
  99. import javafx.stage.Stage;
  100.  
  101.  
  102. /**
  103. * Created by korisnik on 15.1.2019..
  104. */
  105. public class Program extends Application{
  106. public static void main(String[] args) {
  107. launch(args);
  108. }
  109. @Override
  110. public void start(Stage primaryStage) throws Exception {
  111. primaryStage.setTitle("Vezba 11");
  112. primaryStage.setWidth(500.0);
  113. primaryStage.setHeight(700.0);
  114. Parent korenskiCvor=new GridPane();
  115.  
  116. Button dugme1= new Button("Dugme 1");
  117. dugme1.setStyle("-fx-background-color: aqua;-fx-border-style: dotted");
  118.  
  119.  
  120. GridPane.setConstraints(dugme1,0,0);
  121.  
  122. ObservableList<Node> listaCvorova=((GridPane)korenskiCvor).getChildren();
  123. listaCvorova.add(dugme1);
  124.  
  125. TextField tfUnos=new TextField();
  126. ((GridPane)korenskiCvor).add(tfUnos,1,1);
  127.  
  128. FlowPane fp=new FlowPane();
  129. fp.getChildren().add(new Label("Labela 1"));
  130. fp.getChildren().add(new Label("Labela 2"));
  131. fp.getChildren().add(new Label("Labela 3"));
  132. fp.getChildren().add(new Label("Labela 4"));
  133. ((GridPane)korenskiCvor).add(fp,2,0);
  134.  
  135.  
  136. HBox hB=new HBox(30);
  137. hB.getChildren().add(new CheckBox("Izbor 1"));
  138. hB.getChildren().add(new CheckBox("Izbor 2"));
  139. hB.getChildren().add(new CheckBox("Izbor 3"));
  140. hB.getChildren().add(new CheckBox("Izbor 4"));
  141.  
  142.  
  143. VBox vB=new VBox(40);
  144. RadioButton rb1=new RadioButton("Muski");
  145. RadioButton rb2=new RadioButton("Zenski");
  146. vB.getChildren().addAll(rb1,rb2);
  147. ToggleGroup tgPol=new ToggleGroup();
  148. rb1.setToggleGroup(tgPol);
  149. rb2.setToggleGroup(tgPol);
  150. ((GridPane)korenskiCvor).add(vB,0,2);
  151.  
  152.  
  153. Scene scena=new Scene(korenskiCvor);
  154. primaryStage.setScene(scena);
  155. primaryStage.show();
  156. }
  157. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement