Table of Contents
Unit Converter application with User Interface (UI) use to convert one unit to another that have the same type of unit.
Unit Types in the application:
- Currency: Thai Baht (THB), US Dollar (USD), Chinese Yuan (CNY), Japanese Yen (JPY), Korean Won (KRW) and Hong Kong Dollar (HKD)
- Length: Meter, Centimeter, Kilometer, Inch, Mile, Yard, Sok and Yod
- Temperature: Celsius, Kelvin, Fahrenheit, Rankine_Scale and Delisle_Scale
- Volume: Litre, Millilitre, Cubic_Kilometer, Cubic_Meter, Teaspoon, Gallon, Gwian and Thang
- Weight: Kilogram, Gram, Milligram, Metric_Ton, Ounce, Stone, Chung and Harb
- This design pattern use in CurrencyConverter class, so that when I use this class in CurrencyConverterController class, I only call getCurrencyInstance() to use it.
- This design pattern use for the convert() method which will calculate and return the converted value in different strategy depends on the unit type.
- This design pattern use in UnitFactory class, this really useful when user change the unit type that user want to convert (for example, change from Length to Volume), UnitConverterController class no need to worry about create the object of that unit because UnitFactory class will choose and create those unit for UnitConverterController class to use.
Since my app doesn't have .jar file to run, then you can download/clone this project and run Main.java
file.
After you run the Main.java
file, ...
-
Click to converter that you want or you can read the app instructions instead.
-
If you click
How to use?
-
If you click converter, ...
-
Unit Converter
- Click
Unit Type
in menu bar to select unit to covert. - Select base unit (Top) and unit to convert to (Bottom).
- Input number that want to convert in text field (Top one).
- Click "Convert" button OR press Enter to convert.
- Get your result :)
- Click
-
Currency Converter
- Select currency unit that want to convert to.
- Input amount of Thai Baht (THB) that want to convert in text field.
- Click "Convert" button OR press Enter to convert.
- Get your result :)
- There're 2 ways to clear text field in both converters:
- Press "Clear" button.
- Click at text field 1 time.
-
Created by 6010545692 Kunyaruk Katebulu