# Com / Github / Blaxk3 / Converter

## Overview

The `com.github.blaxk3.converter` package appears to be the application entry point for a Swing-based currency converter. Its only job is to bootstrap the UI on the Event Dispatch Thread so the desktop interface starts safely and in the expected Swing threading model.

This module is intentionally small: it does not contain conversion logic itself, but instead hands control to the UI layer in [`com.github.blaxk3.ui`](src/main/java/com/github/blaxk3/ui/UI.java). That makes this package the thin launch boundary between the JVM process and the rest of the application.

## Key Classes and Interfaces

### [`CurrencyConverter`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:7)

`CurrencyConverter` is the main application class. It exists as the executable entry point for the program and contains the only method in this package, `main(String[] args)`.

Its design role is straightforward:
- provide a standard Java `main` method for launching the app
- ensure the UI is created on Swing's Event Dispatch Thread
- delegate actual screen construction to `UI`

#### Method: [`CurrencyConverter.main(String[] args)`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:8)

- **Purpose:** Starts the application.
- **Parameters:** `String[] args`, the usual JVM command-line arguments. The method does not inspect them.
- **Returns:** `void`.
- **Behavior:** Calls `SwingUtilities.invokeLater(UI::new)` so that a new `UI` instance is created asynchronously on the Swing event thread.
- **Side effects:** Initializes the user interface and starts the desktop application.

This method is deliberately minimal and contains no business rules, validation, or conversion behavior. That suggests the actual product logic lives behind the UI layer.

## How It Works

The startup path is very short:

1. The JVM launches `com.github.blaxk3.converter.CurrencyConverter`.
2. `main` runs immediately.
3. `SwingUtilities.invokeLater(...)` schedules UI construction on the Swing Event Dispatch Thread.
4. `UI` is instantiated when Swing processes that queued task.

This pattern is important in Swing applications because UI creation and UI updates must happen on the event thread to avoid threading bugs and inconsistent rendering. In other words, this module exists mainly to start the application correctly rather than to implement user-facing behavior itself.

```mermaid
flowchart TD
    Main["CurrencyConverter.main"] --> InvokeLater["SwingUtilities.invokeLater"]
    InvokeLater --> UIInit["UI constructor"]
```

## Dependencies and Integration

This package has one direct dependency visible in the source:

- [`com.github.blaxk3.ui.UI`](src/main/java/com/github/blaxk3/ui/UI.java) — the UI object that is created when the application starts.

It also depends on the standard Swing utility class `SwingUtilities`, which provides the threading handoff. That dependency is what makes the startup code compliant with Swing's single-threaded UI model.

## Notes for Developers

- `CurrencyConverter` is a launcher, not a feature module. If you need to change converter behavior, the more likely place is the UI package or whatever services the UI calls.
- The use of `SwingUtilities.invokeLater` is a deliberate threading choice. Avoid constructing Swing components directly from `main` unless you also preserve Event Dispatch Thread safety.
- Because `main` ignores `args`, the application currently does not support command-line configuration through this entry point.
- The package surface is very small, so future expansion will likely happen by adding more behavior to `com.github.blaxk3.ui` or adjacent packages rather than to this launcher class.
