Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Andrew Woods
- 15.5
- */
- package javafxapplication1;
- import javafx.application.Application;
- import javafx.geometry.Pos;
- import javafx.geometry.HPos;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.control.Label;
- import javafx.scene.control.TextField;
- import javafx.scene.layout.GridPane;
- import javafx.stage.Stage;
- public class InvestmentCalc extends Application
- {
- private TextField tfInvestAmt = new TextField();
- private TextField tfYears = new TextField();
- private TextField tfAnnualInterestRate = new TextField();
- private TextField tfFutureVal = new TextField();
- private Button btCalc = new Button ("Calculate");
- @Override
- public void start(Stage primaryStage)
- {
- GridPane gridpane = new GridPane();
- gridpane.setHgap(5);
- gridpane.setVgap(5);
- gridpane.add(new Label("Investment Amount:"),0,0)
- gridpane.add(tfInvestAmt,1,0);
- gridpane.add(new Label("Investment Amount:"),0,1)
- gridpane.add(tfYears,1,1);
- gridpane.add(new Label("Investment Amount:"),0,2)
- gridpane.add(tfAnnualInterestRate,1,2);
- gridpane.add(new Label("Investment Amount:"),0,3)
- gridpane.add(tfFutureVal,1,3);
- gridpane.add(btCalc,1,4);
- gridpane.setAlignment(Pos.CENTER);
- tfInvestAmt.setAlignment(Pos.BOTTOM_RIGHT);
- tfYears.setAlignment(Pos.BOTTOM_RIGHT);
- tfAnnualInterestRate.setAlignment(Pos.BOTTOM_RIGHT);
- tfFutureVal.setAlignment(Pos.BOTTOM_RIGHT);
- }
- public static void main(String[] args)
- {
- launch(args);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement