---

# (DD06) Business Logic — UI.comboBox2() [7 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.github.blaxk3.ui.UI` |
| Layer | Utility |
| Module | `ui` (Package: `com.github.blaxk3.ui`) |

## 1. Role

### UI.comboBox2()

This method builds and returns the second currency selection combo box used by the UI. It creates a fresh `JComboBox<String>`, applies a fixed presentation size for consistent screen layout, and then delegates data population to the asynchronous `CurrencyCode` worker. In business terms, the method prepares the destination control for the user to select a source or target currency code, ensuring the list is populated from the live currency-code feed rather than from hardcoded values.

The method implements a simple construction-and-delegation pattern: it owns the UI component instantiation and sizing, while the actual business data retrieval is delegated to `CurrencyCode.execute()`. This makes the method a shared presentation utility rather than a decision-making routine. It does not branch by service type or constant; instead, it standardizes the combo box and triggers asynchronous loading so the screen can remain responsive while codes are fetched.

Within the larger system, `comboBox2()` is one of the form-building helpers used by `UI` to assemble the currency conversion interface. Its role is to ensure the second combo box is ready for display and populated shortly after the screen is rendered, supporting user interaction with current currency data.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["comboBox2()"])
    CREATE["Create JComboBox<String> instance"]
    SIZE["Set preferred size to 300 x 30"]
    WORKER["Instantiate CurrencyCode worker with comboBox2"]
    EXEC["execute() asynchronous fetch"]
    RETURN["Return comboBox2 component"]
    START --> CREATE
    CREATE --> SIZE
    SIZE --> WORKER
    WORKER --> EXEC
    EXEC --> RETURN
```

**CRITICAL — Constant Resolution:**
No business constants are referenced in this method. The method uses only a literal UI size (`300 x 30`) and direct object construction.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|----------------------|
| - | (none) | - | - |

External state read by the method:
- `comboBox2` instance field of `UI` — the combo box widget that is created, configured, and returned.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `CurrencyCode.execute()` | N/A | Currency code feed via `CurrencyRateAPI.getCurrencyCode()` | Starts asynchronous retrieval of available currency codes to populate the UI selection list. |

Notes:
- `comboBox2()` itself does not perform direct database CRUD.
- The only business-side data access is indirect, through the `CurrencyCode` SwingWorker that later calls `CurrencyRateAPI.getCurrencyCode()`.

## 5. Dependency Trace

### Pre-computed evidence from code analysis graph:

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: -

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `UI` internal layout assembly | `UI.panelFramePanel2.add(comboBox2())` -> `UI.comboBox2()` | `CurrencyCode.execute()` [R] CurrencyRateAPI currency-code feed |
| 2 | `UI` internal getter-driven flow | `UI.getComboBox2()` -> `UI.comboBox2()` | `CurrencyCode.execute()` [R] CurrencyRateAPI currency-code feed |

## 6. Per-Branch Detail Blocks

**Block 1** — [SEQUENCE] (L103-L109)

> Builds the second currency combo box and triggers asynchronous population.

| # | Type | Code |
|---|------|------|
| 1 | SET | `comboBox2 = new JComboBox<>();` // create the UI control |
| 2 | EXEC | `comboBox2.setPreferredSize(new Dimension(300, 30));` // standardize screen layout |
| 3 | CALL | `new CurrencyCode(comboBox2).execute();` // start async currency-code loading |
| 4 | RETURN | `return comboBox2;` // hand the configured component back to the caller |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `comboBox2` | Field | Second currency selector control on the UI, used to choose a currency code. |
| `JComboBox` | Technical term | Swing drop-down component used to present selectable values to the user. |
| `Dimension(300, 30)` | Technical term | Fixed UI size definition: 300 pixels wide by 30 pixels high. |
| `CurrencyCode` | Class | Asynchronous worker that fetches currency codes and populates the combo box. |
| `execute()` | Technical term | Starts the SwingWorker asynchronously so the UI is not blocked during data loading. |
| `CurrencyRateAPI` | Class | API client used to retrieve currency-rate-related reference data. |
| Currency code | Business term | Standard code that identifies a currency, such as USD, EUR, or JPY. |
| Source currency | Business term | Currency selected as the starting value in a conversion flow. |
| Target currency | Business term | Currency selected as the destination value in a conversion flow. |
| UI | Class | Presentation layer container that assembles the currency conversion screen. |
