A Java Swing application for converting between volume, length, and temperature units with real-time calculations.
Convert between 13 volume units:
- Gallons
- U.S. Cups
- Tablespoons
- Teaspoons
- Cubic Feet
- Cubic Yards
- Cubic Inches
- Liters
- Milliliters
- Cubic Meters
- Cubic Centimeters
- Quarts
- Pints
Convert between 8 length units:
- Miles
- Yards
- Feet
- Inches
- Meters
- Kilometers
- Centimeters
- Nautical Miles
Convert between 3 temperature units:
- Fahrenheit
- Celsius
- Kelvin
- Select Conversion Type
- Choose between Volume, Length, or Temperature using the tabbed interface.
- Generate Conversion Box
- Select source unit from the first dropdown.
- Select target unit from the second dropdown.
- Click Generate Conversion.
- Note: You will get an error message if both units are identical.
- Real-time Conversion
- Enter value in either field.
- Automatic conversion appears in the other field.
- Supports decimal values and negative numbers (
-
by itself becomes-1
).
- Requirements
- Java Development Kit (JDK) 8 or higher.
- Project directory structure:
Java-unit-converter/ ├── App.java ├── fonts/ │ ├── NotoSans-Regular.ttf │ ├── NotoSans-Bold.ttf │ └── EBGaramond-Regular.ttf └── font_licenses/ ├── OFL-Noto_Sans.txt └── OFL-EB_Garamond.txt
- Compile and Run
javac *.java java App
- Troubleshooting
- Fonts not loading?
- Verify the
fonts/
directory exists and filenames match those referenced inApp.java
. - Check file read permissions (especially on UNIX systems).
- Verify the
- Classpath errors?
javac -cp . *.java java -cp . App
- GUI looks odd?
- Ensure custom fonts loaded without errors.
- Watch console for any error messages.
- Fonts not loading?
This application uses the following fonts under the SIL Open Font License (OFL):
- Author: Georg Duffner
- Source: https://github.com/octaviopardo/EBGaramond12
- License: font_licenses/OFL-EB_Garamond.txt
- Author: Google Inc.
- Source: https://github.com/notofonts/latin-greek-cyrillic
- License: font_licenses/OFL-Noto_Sans.txt
This project complies with the Apache License 2.0 and SIL OFL requirements by:
- Including original font files without modification.
- Bundling complete OFL license texts in
font_licenses/
. - Maintaining original copyright notices.
- Not selling fonts independently of the application.
- Providing clear attribution in documentation.
© 2025 richie-rich90454