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

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

## 1. Role

### UI.comboBox2()

`comboBox2()` is a UI factory method that builds the second currency selector in the currency converter screen. It creates a fresh Swing `JComboBox<String>`, configures it with a fixed display size, and delegates the actual list population to `CurrencyCode`, which appears to be the shared component responsible for loading available currency codes into combo boxes.

From a business perspective, this method supports the user’s “to-currency” selection path in the conversion workflow. It does not perform conversion logic itself; instead, it prepares one of the input controls that later feeds the conversion action triggered by the Convert button. The method follows a simple factory-and-delegation pattern: instantiate the component, apply presentation settings, hand the component to a helper for domain-specific data binding, and return it for inclusion in the screen layout.

There are no conditional branches or alternate business paths in this method. Its role is deterministic and reusable: create the destination currency dropdown in a standardized way so that the screen can rely on consistent size and content loading behavior.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START["comboBox2()"]
    A["Instantiate JComboBox<String> and assign to comboBox2 field"]
    B["Set preferred size to 300 x 30"]
    C["Create CurrencyCode with comboBox2"]
    D["Call CurrencyCode.execute() to populate currency options"]
    E["Return comboBox2 as Component"]
    START --> A
    A --> B
    B --> C
    C --> D
    D --> E
```

**CRITICAL — Constant Resolution:**
No business constants are referenced in this method. The only fixed values are UI dimensions (`300`, `30`), which are literal presentation values rather than domain constants.

## 3. Parameter Analysis

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

**External state read by the method:** instance field `comboBox2` is assigned and then returned; no other instance fields or external business state are read.

## 4. CRUD Operations / Called Services

This method performs no CRUD operation against a database or persistent store. Its only call is to a UI population helper that likely performs reference-data loading for the combo box.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|-----------------------|
| R | `execute()` on `CurrencyCode` | - | Currency code reference data / combo box model | Populates the currency selector with available currency options for user selection |

**Called methods within the method:**
- `new CurrencyCode(comboBox2).execute()` — loads selectable currency codes into the second combo box.

## 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 reference data` |

`comboBox2()` is called from the screen composition method `panel()`, where it is inserted into the second row of the converter form. The method itself terminates in a UI population helper rather than a database endpoint, so the dependency trace ends at reference-data loading for the combo box model.

## 6. Per-Branch Detail Blocks

**Block 1** — [SEQUENCE] `(method entry)` (L103)

> Initializes the destination currency selector component.

| # | Type | Code |
|---|------|------|
| 1 | SET | `comboBox2 = new JComboBox<>();` |

**Block 2** — [SEQUENCE] `(presentation configuration)` (L104)

> Applies a fixed size so the currency selector aligns with the rest of the form layout.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `comboBox2.setPreferredSize(new Dimension(300, 30));` |

**Block 3** — [SEQUENCE] `(reference data binding)` (L105)

> Delegates to the currency code loader so the combo box receives selectable currency entries.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `new CurrencyCode(comboBox2).execute();` |

**Block 4** — [SEQUENCE] `(return)` (L107)

> Returns the prepared component to the caller for screen assembly.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return comboBox2;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `comboBox2` | Field | The second combo box on the currency converter screen, used as the destination currency selector |
| `comboBox1` | Field | The first combo box on the currency converter screen, used as the source currency selector |
| `CurrencyCode` | Class | UI helper that populates a currency selector with available currency values |
| `execute()` | Method | Helper execution step that loads data into a UI component |
| `Component` | Technical term | Swing base type returned so the UI factory method can be inserted into the layout |
| `JComboBox` | Technical term | Swing dropdown control used for selecting one item from a list |
| `Dimension` | Technical term | Swing sizing object used to control component width and height |
| `UI.panel()` | Method | Screen assembly method that places the combo box into the overall form layout |
| `Currency` | Business term | Monetary unit used as the input/output currency in the converter |
| `Reference data` | Business term | Static or semi-static selectable values that populate the currency dropdown |
