Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package samostalni;
- import javafx.application.Application;
- import javafx.collections.ObservableList;
- import javafx.scene.Node;
- import javafx.scene.Parent;
- import javafx.scene.Scene;
- import javafx.scene.control.Label;
- import javafx.scene.control.RadioButton;
- import javafx.scene.control.TextField;
- import javafx.scene.control.ToggleGroup;
- import javafx.scene.layout.FlowPane;
- import javafx.scene.layout.GridPane;
- import javafx.scene.layout.HBox;
- import javafx.scene.layout.VBox;
- import javafx.stage.Stage;
- /**
- * Created by korisnik on 15.1.2019..
- */
- public class Samostalni extends Application{
- public static void main(String[] args) { launch(args);}
- @Override
- public void start (Stage primaryStage) throws Exception {
- primaryStage.setTitle("Billing Information");
- primaryStage.setWidth(500.0);
- primaryStage.setHeight(700.0);
- Parent korenskiCvor=new GridPane();
- ObservableList<Node> listaCvorova=((GridPane)korenskiCvor).getChildren();
- Label l1=new Label("First Name:");
- ((GridPane)korenskiCvor).add(l1,0,0);
- Label l2=new Label("Last Name:");
- ((GridPane)korenskiCvor).add(l2,0,1);
- Label l3=new Label("Gender:");
- ((GridPane)korenskiCvor).add(l3,0,2);
- Label l4=new Label("Languages:");
- ((GridPane)korenskiCvor).add(l4,0,3);
- Label l5=new Label("Email:");
- ((GridPane)korenskiCvor).add(l5,0,4);
- Label l6=new Label("Adress:");
- ((GridPane)korenskiCvor).add(l6,0,5);
- Label l7=new Label("State:");
- ((GridPane)korenskiCvor).add(l7,0,6);
- Label l8=new Label("Zip:");
- ((GridPane)korenskiCvor).add(l8,0,7);
- Label l9=new Label("Credit Card Type:");
- ((GridPane)korenskiCvor).add(l9,0,8);
- TextField tfUnos=new TextField();
- ((GridPane)korenskiCvor).add(tfUnos,1,0);
- TextField tfUnos1=new TextField();
- ((GridPane)korenskiCvor).add(tfUnos1,1,1);
- HBox hB=new HBox(40);
- RadioButton rb1=new RadioButton("Muski");
- RadioButton rb2=new RadioButton("Zenski");
- hB.getChildren().addAll(rb1,rb2);
- ToggleGroup tgPol=new ToggleGroup();
- rb1.setToggleGroup(tgPol);
- rb2.setToggleGroup(tgPol);
- ((GridPane)korenskiCvor).add(hB,1,2);
- Scene scena=new Scene(korenskiCvor);
- primaryStage.setScene(scena);
- primaryStage.show();
- }
- }
- package glavni;
- import javafx.application.Application;
- import javafx.collections.ObservableList;
- import javafx.scene.Group;
- import javafx.scene.Node;
- import javafx.scene.Parent;
- import javafx.scene.Scene;
- import javafx.scene.control.*;
- import javafx.scene.control.Label;
- import javafx.scene.control.TextField;
- import javafx.scene.layout.FlowPane;
- import javafx.scene.layout.GridPane;
- import javafx.scene.layout.HBox;
- import javafx.scene.layout.VBox;
- import javafx.stage.Stage;
- /**
- * Created by korisnik on 15.1.2019..
- */
- public class Program extends Application{
- public static void main(String[] args) {
- launch(args);
- }
- @Override
- public void start(Stage primaryStage) throws Exception {
- primaryStage.setTitle("Vezba 11");
- primaryStage.setWidth(500.0);
- primaryStage.setHeight(700.0);
- Parent korenskiCvor=new GridPane();
- Button dugme1= new Button("Dugme 1");
- dugme1.setStyle("-fx-background-color: aqua;-fx-border-style: dotted");
- GridPane.setConstraints(dugme1,0,0);
- ObservableList<Node> listaCvorova=((GridPane)korenskiCvor).getChildren();
- listaCvorova.add(dugme1);
- TextField tfUnos=new TextField();
- ((GridPane)korenskiCvor).add(tfUnos,1,1);
- FlowPane fp=new FlowPane();
- fp.getChildren().add(new Label("Labela 1"));
- fp.getChildren().add(new Label("Labela 2"));
- fp.getChildren().add(new Label("Labela 3"));
- fp.getChildren().add(new Label("Labela 4"));
- ((GridPane)korenskiCvor).add(fp,2,0);
- HBox hB=new HBox(30);
- hB.getChildren().add(new CheckBox("Izbor 1"));
- hB.getChildren().add(new CheckBox("Izbor 2"));
- hB.getChildren().add(new CheckBox("Izbor 3"));
- hB.getChildren().add(new CheckBox("Izbor 4"));
- VBox vB=new VBox(40);
- RadioButton rb1=new RadioButton("Muski");
- RadioButton rb2=new RadioButton("Zenski");
- vB.getChildren().addAll(rb1,rb2);
- ToggleGroup tgPol=new ToggleGroup();
- rb1.setToggleGroup(tgPol);
- rb2.setToggleGroup(tgPol);
- ((GridPane)korenskiCvor).add(vB,0,2);
- Scene scena=new Scene(korenskiCvor);
- primaryStage.setScene(scena);
- primaryStage.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement