fix: password text field status

This commit is contained in:
hstyi
2025-07-14 11:10:52 +08:00
committed by hstyi
parent 7f1317a9a7
commit a7aec52f2a
3 changed files with 16 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ import java.awt.KeyboardFocusManager
import java.awt.Window
import java.awt.event.ComponentAdapter
import java.awt.event.ComponentEvent
import java.awt.event.ItemEvent
import javax.swing.*
internal open class RDPHostOptionsPane : OptionsPane() {
@@ -223,6 +224,12 @@ internal open class RDPHostOptionsPane : OptionsPane() {
removeComponentListener(this)
}
})
authenticationTypeComboBox.addItemListener {
if (it.stateChange == ItemEvent.SELECTED) {
passwordTextField.isEnabled = authenticationTypeComboBox.selectedItem == AuthenticationType.Password
}
}
}