This repository contains two Java Swing GUI applications: a calculator and a registration form with validation.
├── Calculator.java # Calculator application with arithmetic operations
├── RegisterForm.java # Registration form with input validation
└── README.md # This documentation file
A fully functional calculator built with Java Swing that supports basic arithmetic operations.
- Basic Operations: Addition (+), Subtraction (-), Multiplication (*), Division (/)
- Number Input: Digits 0-9 and decimal point (.)
- Control Functions:
- Clear (resets everything)
- Delete (removes last character)
- Equals (=) to perform calculations
- Error Handling: Basic operation handling with double precision arithmetic
Text display field at the top
Number buttons arranged in grid layout
Operation buttons on the right column
Clear/Delete buttons at the bottom
Clear (resets everything)
Delete (removes last character)
Equals (=) to perform calculations
Error Handling: Basic operation handling with double precision arithmetic
A signup form with input validation for user registration data.
- Name (must be at least 3 characters)
- First Address (text field)
- Second Address (must be different from first address)
- Age (must be 18 or older)
- Height (must be 100cm or taller)
- Weight (must be 40kg or heavier)
- Name validation: Minimum 3 characters
- Address validation: First and second addresses must be different
- Age validation: Minimum 18 years
- Height validation: Minimum 100cm
- Weight validation: Minimum 40kg
- Clean form layout with labeled fields
- Persian "ثبت نام" (Registration) button
- Console output for validation results
- Success/failure messages with detailed output
Java Development Kit (JDK) 8 or higher
Any Java IDE or command line compiler
No handling for division by zero
Basic delete implementation (could be optimized)
Fixed window size (400x400 pixels)
All validation messages are printed to console
No visual error indicators in the GUI
Form uses absolute positioning (null layout)
- Add keyboard support
- Implement memory functions (M+, M-, MR, MC)
- Add percentage calculation
- Handle division by zero gracefully
- Add scientific calculator functions
- Add visual error indicators
- Include input labels for each field
- Add password field with confirmation
- Implement data persistence (file/database)
- Add email validation