
no.tornado.databinding.uibridge.JPasswordFieldBridge Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of databinding Show documentation
Show all versions of databinding Show documentation
Swing Data Binding is a powerful, fast, light and simple data binding framework for Java.
The newest version!
package no.tornado.databinding.uibridge;
import no.tornado.databinding.converter.ConversionException;
import javax.swing.*;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentListener;
public class JPasswordFieldBridge implements UIBridge {
static JPasswordFieldBridge INSTANCE = new JPasswordFieldBridge();
private JPasswordFieldBridge() { }
public Class getUIClass() {
return JPasswordField.class;
}
public void setUIValue(JPasswordField component, String value) throws ConversionException {
component.setText(value);
}
public String getUIValue(JPasswordField component) throws ConversionException {
return new String(component.getPassword());
}
public Class extends String> getUIValueType() {
return String.class;
}
public DocumentListener addValueChangeListener(JPasswordField component, ChangeListener listener) {
DocumentListener documentListener = new DocumentChangeListener(listener);
component.getDocument().addDocumentListener(documentListener);
return documentListener;
}
public void removeValueChangelistener(JPasswordField component, DocumentListener listener) {
component.getDocument().removeDocumentListener(listener);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy