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.Component
import java.awt.KeyboardFocusManager
import java.awt.event.ComponentAdapter
import java.awt.event.ComponentEvent
import java.awt.event.ItemEvent
import java.nio.charset.Charset
import javax.swing.*
@@ -246,6 +247,12 @@ class FTPHostOptionsPane : OptionsPane() {
removeComponentListener(this)
}
})
authenticationTypeComboBox.addItemListener {
if (it.stateChange == ItemEvent.SELECTED) {
passwordTextField.isEnabled = authenticationTypeComboBox.selectedItem == AuthenticationType.Password
}
}
}
override fun getIcon(isSelected: Boolean): Icon {
@@ -378,7 +385,7 @@ class FTPHostOptionsPane : OptionsPane() {
}
}
enum class PassiveMode {
enum class PassiveMode {
Local,
Remote,
}