Build a JavaFX Scientific Calculator GUI Desktop App in Java Full Project For Beginners

  • Post author:
  • Post category:Java
  • Post comments:0 Comments

 

 

main.java

 

 

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.opeyemi.scientificcalculator;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
 *
 * @author Idris Opeyemi
 */
public class ScientificCalculator extends Application {

    private static Stage primaryStage;

    public static Stage getPrimaryStage() {
        return primaryStage;
    }

    public static void setPrimaryStage(Stage primaryStage) {
        ScientificCalculator.primaryStage = primaryStage;
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        Font.loadFont(getClass().getResource("/font/digital-7.ttf").toExternalForm(), 10);

        Parent root = FXMLLoader.load(getClass().getResource("/fxml/ScientificCalculator.fxml"));
        System.out.println(root.toString());
        root.getStyleClass().add("anchorPane");
        Scene scene = new Scene(root);
        scene.setFill(Color.TRANSPARENT);
        primaryStage.setX(500.0);
        primaryStage.setY(80.0);
        primaryStage.setWidth(350);
        primaryStage.setHeight(600);
        primaryStage.setTitle("Calculator");
        primaryStage.setScene(scene);
        primaryStage.setResizable(false);
        primaryStage.initStyle(StageStyle.TRANSPARENT);
        primaryStage.show();
//        primaryStage.styl
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }

}

 

 

Scientific Calculator

This scientific calculator is a standard school calculator built in java FX and it almost a replica of the casio fx-82ms calculator with the some features and functionalities.

See also  Build a PDF Generator Android App in Kotlin or Java From HTML Template Full Project For Beginners

 

 

 

 

DOWNLOAD FULL SOURCE CODE

 

 

Leave a Reply