07-20-2023, 03:34 PM
I am having Overload Resolution Ambiguity error in this line:
`departureHourChoice!!.selectionModel.select(currentHourIndex)`
For Reference:
- `departureHourChoice` is a `ChoiceBox<Int>`, which is from `java.scene.control`
- `currentHourIndex` is an `Int`
- The Overload Resolution Ambiguity happens in the `.select()` method; It is overloaded and can accept two kinds of parameters: `(T obj)` or `(int index)`.
- The `.select()` method allows for an item in a `ChoiceBox` to be selected, and you can determine which one can be selected by referencing to that item or to it's index. In this case, I want it to be selected by Index (`int`).
- Here is a photo of the error[![enter image description here][1]][1]
How would one resolve the Overload Resolution Ambiguity?
[1]:
`departureHourChoice!!.selectionModel.select(currentHourIndex)`
For Reference:
- `departureHourChoice` is a `ChoiceBox<Int>`, which is from `java.scene.control`
- `currentHourIndex` is an `Int`
- The Overload Resolution Ambiguity happens in the `.select()` method; It is overloaded and can accept two kinds of parameters: `(T obj)` or `(int index)`.
- The `.select()` method allows for an item in a `ChoiceBox` to be selected, and you can determine which one can be selected by referencing to that item or to it's index. In this case, I want it to be selected by Index (`int`).
- Here is a photo of the error[![enter image description here][1]][1]
How would one resolve the Overload Resolution Ambiguity?
[1]: