Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Scientific Calculator (Java Swing)

Simple scientific calculator implemented in Java using Swing. Demonstrates event handling (ActionListener) and exception handling (try/catch).

Files

Build & Run (command line on Windows)

  1. Open a terminal in the project root d:\hobby\calculator.
  2. Compile:
javac -d out src\Calculator.java
  1. Run:
java -cp out Calculator

Usage

  • Click number buttons to enter values.
  • Use +, -, *, / for arithmetic; press = to compute.
  • Scientific functions (sin, cos, tan, log, sqrt, x^2, pi) apply immediately to the shown value.
  • AC clears all state.

Exception handling

  • Division by zero shows: "Error: Division by zero is not allowed"
  • Invalid or empty input shows: "Invalid Input"
  • Unexpected errors show a generic message; the app does not crash.

Notes

  • Angles for trigonometric functions are interpreted in degrees.
  • This is a compact educational example intended for learning event and exception handling.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages