A Java Swing application for converting temperatures between Celsius, Fahrenheit, and Kelvin. The project demonstrates object-oriented programming concepts including interfaces, encapsulation, inheritance, and polymorphism.
| From | To |
|---|---|
| Celsius | Fahrenheit, Kelvin |
| Fahrenheit | Celsius, Kelvin |
| Kelvin | Celsius, Fahrenheit |
| Any supported unit | The same unit |
The application rejects values below absolute zero:
- Celsius:
-273.15 °C - Fahrenheit:
-459.67 °F - Kelvin:
0 K
The Java sources use the com.tempconverter package:
TemperatureConverterGUI.java— Swing user interface and input validation.TemperatureConverter.java— Selects and runs the appropriate conversion.Convertible.java— Common conversion interface.CelsiusToFahrenheit.java,FahrenheitToCelsius.java— Celsius/Fahrenheit conversions.CelsiusToKelvin.java,KelvinToCelsius.java— Celsius/Kelvin conversions.
Compiled .class files are generated artifacts and are not required to run the project from source.
- Java Development Kit (JDK) 8 or newer.
- A graphical desktop environment for the Swing interface.
From the repository root, compile the package sources into a separate output directory:
mkdir -p out
javac -d out *.java
java -cp out com.tempconverter.TemperatureConverterGUIOn Windows PowerShell, the equivalent commands are:
New-Item -ItemType Directory -Force out
javac -d out *.java
java -cp out com.tempconverter.TemperatureConverterGUI- Enter a numeric temperature.
- Select the input unit.
- Select the output unit.
- Click Convert.
Invalid numbers and physically impossible temperatures are reported before conversion.
This project is licensed under the MIT License. See LICENSE for details.