A modern and user-friendly calculator built with Java Swing.
Supports basic arithmetic, percentage, sign toggle, clear, backspace, and keyboard input.
- ➕ ➖ ✖️ ➗ Basic arithmetic operations
- 🧾 Decimal support
- 🔙 Backspace & Clear (C)
- 🔄 Toggle sign (±)
- 📊 Percentage (%) support
- ⌨️ Keyboard shortcuts
- 🖥️ Cross-platform desktop app
📦 java-calculator ┣ 📜 Calculator.java # Main calculator code ┣ 📜 README.md # Project documentation
A modern, GUI-based calculator built with Java Swing and BigDecimal
for precision.
Supports arithmetic operations (+
, −
, ×
, ÷
), percentages, sign toggle, and backspace.
Styled with a clean UI to give you a lightweight but beautiful desktop calculator.
- 🎨 Sleek Swing-based GUI (not console)
- 🔢 High-precision calculations using
BigDecimal
- ➕➖✖️➗ Basic arithmetic operations
- % Percentage and ± sign toggle support
- ⌫ Backspace for corrections
- ⌨️ Full keyboard support (numbers, Enter, operators, Backspace, Esc)
git clone https://github.com/anshumanjadiya1102/Java_Beauty_Calculator.git
cd Java_Beauty_Calculator
---
'''
⚠️ Important: This is a GUI application.
It requires a graphical environment (Windows, macOS, or Linux desktop).
If you are on Linux server/WSL, you’ll need an X11 server (e.g. Xming, VcXsrv) or run with:
xvfb-run java Java_Beauty_Calculator
🎹 Keyboard Shortcuts
Key Action
0–9 Enter digits
. Decimal point
+ Addition
- Subtraction
* Multiplication
/ Division
Enter Equals (=)
Esc Clear (C)
Backspace Delete last digit
% Percentage
± Toggle sign
📦 Build a .jar
If you want to create a portable JAR file:
javac Java_Beauty_Calculator.java
jar cfe Calculator.jar Java_Beauty_Calculator *.class
java -jar Calculator.jar