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

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

## 1. Role

### UI.comboBox2()

This method constructs the second combo box used by the UI and prepares it for immediate use in the screen layout. Its business role is to provide a reusable presentation component for selecting a currency code, specifically the selector that complements the first combo box in the same screen. The method follows a simple factory-style creation pattern: it instantiates the Swing component, applies a fixed presentation size, and then delegates population logic to the nested `CurrencyCode` worker.

From a system perspective, this method acts as a UI assembly helper rather than a business-rule engine. It encapsulates the screen-specific setup of the second dropdown so that the screen builder can add it to the panel without duplicating configuration logic. There are no conditional branches in this method; the processing is linear and always ends by returning the prepared component.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START["comboBox2()"]
    CREATE["Instantiate JComboBox<String> for currency selection"]
    SIZE["Set preferred size to 300 x 30"]
    WORKER["new CurrencyCode(comboBox2).execute()"]
    RETURN_NODE["Return comboBox2"]
    START --> CREATE
    CREATE --> SIZE
    SIZE --> WORKER
    WORKER --> RETURN_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method has no explicit parameters. It relies on the enclosing `UI` instance state and creates the combo box internally. |

External state read by the method:
- `comboBox2` instance field: the component created and configured by this method.
- `CurrencyCode` nested worker: used to populate the combo box options asynchronously.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `CurrencyCode.execute()` | - | UI combo box option source | Populates the second currency selector with available items. |

Notes:
- `CurrencyCode` is a nested `SwingWorker`, not a server-side SC/CBS service.
- No database table access is visible in this method itself.

## 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 layout builder | `UI` screen setup -> `panelFramePanel2.add(comboBox2())` -> `UI.comboBox2()` | `CurrencyCode.execute() [C] UI combo box option source` |

## 6. Per-Branch Detail Blocks

**Block 1** — `SET` `(L103)`

> Create the second combo box component for the screen.

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

**Block 2** — `SET` `(L104)`

> Apply the fixed presentation size used by the UI layout.

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

**Block 3** — `CALL` `(L105)`

> Delegate option loading to the nested currency-code worker.

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

**Block 4** — `RETURN` `(L107)`

> Return the prepared component to the caller for insertion into the screen.

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `comboBox2` | UI field | The second dropdown selector on the screen, used to choose a currency-related option. |
| `JComboBox` | Technical term | Swing combo box component that lets the user choose one value from a list. |
| `CurrencyCode` | Nested worker | Background loader that fills the combo box with currency code options. |
| `SwingWorker` | Technical term | Java concurrency helper used to perform background work without blocking the UI thread. |
| `Dimension(300, 30)` | UI setting | Fixed width and height for the dropdown component in the layout. |
| `UI` | Class | Presentation class responsible for assembling screen components. |
