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

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

## 1. Role

### UI.comboBox2()

This method builds the second currency selection control used by the currency converter screen. It instantiates a new Swing `JComboBox<String>`, stores it in the `comboBox2` instance field, applies a fixed display size, and then delegates population of the list items to `CurrencyCode.execute()`. In business terms, it represents the destination currency selector in the UI, allowing the user to choose the currency they want to convert into. The method follows a simple factory-and-delegation pattern: create the UI component, configure its presentation, and hand off data loading to a dedicated helper object. There are no conditional branches, loops, or alternate service paths in this method; its behavior is deterministic and always returns the configured combo box. This method is a shared UI construction routine within the screen class and is used when assembling the converter panel layout.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START["comboBox2()"]
    CREATE["Create new JComboBox<String> and assign to comboBox2 field"]
    SIZE["Set preferred size to 300 x 30"]
    LOAD["Instantiate CurrencyCode with comboBox2 and execute()"]
    RETURN_NODE["Return comboBox2 as Component"]
    START --> CREATE
    CREATE --> SIZE
    SIZE --> LOAD
    LOAD --> RETURN_NODE
```

## 3. Parameter Analysis

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

Instance state read by the method: none. Instance state written by the method: `comboBox2` field is assigned the newly created combo box and then passed to `CurrencyCode` for population.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `CurrencyCode.execute()` | - | UI combo-box item source (currency code list) | Populates the destination-currency selector with available currency codes so the user can choose the target currency for conversion. |

Notes:
- The method does not directly access a database or entity table.
- `CurrencyCode.execute()` is treated as a create/populate operation because it fills the combo box with selectable business values.

## 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.comboBox2()` | `CurrencyCode.execute() [C] currency code list` |

## 6. Per-Branch Detail Blocks

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

> Builds the destination currency combo box and delegates item population to a helper component.

| # | Type | Code |
|---|------|------|
| 1 | SET | `comboBox2 = new JComboBox<>();` // create destination currency selector |
| 2 | EXEC | `comboBox2.setPreferredSize(new Dimension(300, 30));` // fix the selector size for layout consistency |
| 3 | CALL | `new CurrencyCode(comboBox2).execute();` // load available currency codes into the selector |
| 4 | RETURN | `return comboBox2;` // return the configured component |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `comboBox2` | Field | Destination currency selector used by the converter UI. |
| `CurrencyCode` | Class | Helper responsible for loading the list of supported currency codes into a combo box. |
| `execute()` | Method | Trigger method that performs the combo-box population work. |
| `JComboBox` | Technical term | Swing drop-down control that lets the user choose one value from a list. |
| `Component` | Technical term | Base UI type returned so the method can be used in Swing layout assembly. |
| UI | Technical term | Presentation layer class that constructs the currency converter screen. |
| currency code list | Business term | The supported set of currency identifiers displayed for user selection. |
| destination currency | Business term | The target currency to which the entered amount will be converted. |
| source currency | Business term | The original currency selected in the first combo box for conversion input. |
| Currency Converter | Business term | The screen/application purpose: convert monetary values between currencies. |
---
