---

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

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

## 1. Role

### UI.comboBox2()

`comboBox2()` is a UI construction method that creates the second currency selector in the currency converter screen. Its business role is to provide the destination-currency input control that the user uses to choose the target currency for conversion results. The method does not perform any conversion itself; instead, it initializes a Swing `JComboBox`, applies a fixed display size, and delegates population of the selectable values to `CurrencyCode`. This follows a lightweight factory-plus-delegation pattern commonly used in presentation layers, where the screen builds the component and a supporting class loads the business list of available codes.

In the larger system, this method is part of the screen composition flow for the `UI` frame and is invoked when the panel is assembled. The returned component is inserted into the second row of the main UI, alongside the output label and action buttons. Because the same population delegate is used for both combo boxes, `comboBox2()` participates in a shared reuse pattern for loading currency options consistently across the source and destination selectors. The method has no conditional branches, loops, or alternate flows; it is a straight initialization path from component creation to return.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START["comboBox2()"]
    N1["Instantiate JComboBox<String>"]
    N2["Set preferred size to 300 x 30"]
    N3["Create CurrencyCode with comboBox2"]
    N4["Call execute() to load currency options"]
    END_NODE["Return comboBox2 component"]
    START --> N1
    N1 --> N2
    N2 --> N3
    N3 --> N4
    N4 --> END_NODE
```

**CRITICAL — Constant Resolution:**
No business constants, branch constants, or constant-driven conditions are present in this method.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | `comboBox2()` takes no parameters. It operates only on internal UI state and builds the destination currency selector component. |

Instance fields and external state read by the method:
- `comboBox2` field of `UI` — stores the created destination currency combo box for later access by other UI actions such as swap and conversion.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `CurrencyCode.execute()` | Not exposed in the inspected source | Currency code list used to populate the combo box | Loads the available currency options into the destination currency selector. This is a read/population operation from the UI perspective. |

Notes:
- The method itself performs no persistence CRUD on database entities.
- The only business-facing call is the delegation to `CurrencyCode.execute()`, which populates the combo box with selectable currency values.
- No DB table or entity name is visible in the inspected source for this method.

## 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 | Screen/UI: `UI.panel()` | `UI.panel()` -> `UI.comboBox2()` | `CurrencyCode.execute() [R] Currency code list` |

## 6. Per-Branch Detail Blocks

**Block 1** — Straight-line initialization `(L103-L109)`

> This block creates the destination currency selector component and prepares it for screen rendering.

| # | Type | Code |
|---|------|------|
| 1 | SET | `comboBox2 = new JComboBox<>();` // instantiate the destination currency combo box |
| 2 | EXEC | `comboBox2.setPreferredSize(new Dimension(300, 30));` // set fixed display dimensions for the selector |
| 3 | CALL | `new CurrencyCode(comboBox2).execute();` // delegate currency option loading into the combo box |
| 4 | RETURN | `return comboBox2;` // return the initialized UI component |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|-------------------|
| `comboBox2` | Field | Destination currency selector used to choose the target currency for conversion results. |
| `comboBox1` | Field | Source currency selector used to choose the currency being converted from. |
| `CurrencyCode` | Class | UI helper responsible for loading available currency codes into a combo box. |
| `execute()` | Method | Execution entry that populates the selector with selectable currency values. |
| `JComboBox` | Technical term | Swing drop-down control used to present selectable currency options. |
| `Dimension(300, 30)` | Technical term | Fixed UI sizing used to standardize the display width and height of the selector. |
| Currency Converter | Business term | Application domain that converts an entered amount from one currency to another. |
| Source currency | Business term | Currency selected as the origin of the conversion. |
| Destination currency | Business term | Currency selected as the target of the conversion result. |
