本文整理了Java中javax.swing.JTextField.addFocusListener()
方法的一些代码示例,展示了JTextField.addFocusListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.addFocusListener()
方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:addFocusListener
暂无
代码示例来源:origin: wildfly/wildfly
private static JTextField createTextField(String name, int length) {
JTextField retval=new JTextField(name, length);
retval.addFocusListener(new MyFocusListener(retval));
return retval;
}
代码示例来源:origin: deathmarine/Luyten
public JTextField getFontStyleTextField() {
if (fontStyleTextField == null) {
fontStyleTextField = new JTextField();
fontStyleTextField.addFocusListener(new TextFieldFocusHandlerForTextSelection(fontStyleTextField));
fontStyleTextField.addKeyListener(new TextFieldKeyHandlerForListSelectionUpDown(getFontStyleList()));
fontStyleTextField.getDocument()
.addDocumentListener(new ListSearchTextFieldDocumentHandler(getFontStyleList()));
fontStyleTextField.setFont(DEFAULT_FONT);
}
return fontStyleTextField;
}
代码示例来源:origin: deathmarine/Luyten
public JTextField getFontFamilyTextField() {
if (fontFamilyTextField == null) {
fontFamilyTextField = new JTextField();
fontFamilyTextField.addFocusListener(new TextFieldFocusHandlerForTextSelection(fontFamilyTextField));
fontFamilyTextField.addKeyListener(new TextFieldKeyHandlerForListSelectionUpDown(getFontFamilyList()));
fontFamilyTextField.getDocument()
.addDocumentListener(new ListSearchTextFieldDocumentHandler(getFontFamilyList()));
fontFamilyTextField.setFont(DEFAULT_FONT);
}
return fontFamilyTextField;
}
代码示例来源:origin: deathmarine/Luyten
public JTextField getFontSizeTextField() {
if (fontSizeTextField == null) {
fontSizeTextField = new JTextField();
fontSizeTextField.addFocusListener(new TextFieldFocusHandlerForTextSelection(fontSizeTextField));
fontSizeTextField.addKeyListener(new TextFieldKeyHandlerForListSelectionUpDown(getFontSizeList()));
fontSizeTextField.getDocument()
.addDocumentListener(new ListSearchTextFieldDocumentHandler(getFontSizeList()));
fontSizeTextField.setFont(DEFAULT_FONT);
}
return fontSizeTextField;
}
代码示例来源:origin: zzz40500/GsonFormat
generateClassLB.setText(currentClass);
generateClassTF.setText(currentClass);
generateClassTF.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent focusEvent) {
代码示例来源:origin: plantuml/plantuml
extensions.addFocusListener(new FocusListener() {
代码示例来源:origin: runelite/runelite
input.addFocusListener(new FocusAdapter()
代码示例来源:origin: runelite/runelite
hexInput.addFocusListener(new FocusAdapter()
代码示例来源:origin: runelite/runelite
nameInput.addActionListener(e -> getParent().requestFocusInWindow());
nameInput.getTextField().addFocusListener(new FocusListener()
displayInput.addActionListener(e -> getParent().requestFocusInWindow());
displayInput.getTextField().addFocusListener(new FocusListener()
代码示例来源:origin: wiztools/rest-client
public UrlComboBox() {
setToolTipText("URL");
setEditable(true);
final JTextField editorComponent = (JTextField) getEditor().getEditorComponent();
editorComponent.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
editorComponent.selectAll();
}
});
AutoCompletion ac = new AutoCompletion(this);
ac.setStrict(false);
ac.setStrictCompletion(false);
}
代码示例来源:origin: nodebox/nodebox
protected JTextComponent createField() {
JTextField textField = new JTextField();
textField.putClientProperty("JComponent.sizeVariant", "small");
textField.setFont(Theme.SMALL_BOLD_FONT);
textField.addActionListener(this);
textField.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
commitTextFieldValue();
}
});
return textField;
}
代码示例来源:origin: nodebox/nodebox
categoryField.addFocusListener(this);
addRow("Category", categoryField);
descriptionField.addFocusListener(this);
addRow("Description", descriptionField);
imageField.addFocusListener(this);
addRow("Image", imageField);
outputTypeField.addFocusListener(this);
addRow("Output Type", outputTypeField);
functionField.addFocusListener(this);
addRow("Function", functionField);
handleField.addFocusListener(this);
addRow("Handle Function", handleField);
代码示例来源:origin: magefree/mage
textField = editor.getTextField();
textField.setHorizontalAlignment(JTextField.LEFT);
textField.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent fe) {
代码示例来源:origin: nodebox/nodebox
valueField.addFocusListener(this);
addRow("Value", valueField);
minimumValueField = new JTextField(10);
minimumValueField.addActionListener(this);
minimumValueField.addFocusListener(this);
JPanel minimumValuePanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
minimumValuePanel.add(minimumValueCheck);
maximumValueField = new JTextField(10);
maximumValueField.addActionListener(this);
maximumValueField.addFocusListener(this);
JPanel maximumValuePanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
maximumValuePanel.add(maximumValueCheck);
代码示例来源:origin: nodebox/nodebox
portNumberField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent focusEvent) {
代码示例来源:origin: ron190/jsql-injection
});
this.textFieldEditable.addFocusListener(new FocusAdapter() {
代码示例来源:origin: nodebox/nodebox
numberField.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
if (numberField.isVisible())
代码示例来源:origin: apache/activemq-artemis
private static JTextField createTextField(String name, int length) {
JTextField retval=new JTextField(name, length);
retval.addFocusListener(new MyFocusListener(retval));
return retval;
}
代码示例来源:origin: apache/activemq-artemis
private static JTextField createTextField(String name, int length) {
JTextField retval=new JTextField(name, length);
retval.addFocusListener(new MyFocusListener(retval));
return retval;
}
代码示例来源:origin: Exslims/MercuryTrade
public JTextField getTitleField(AdrComponentDescriptor descriptor) {
JTextField titleField = this.componentsFactory.getTextField(descriptor.getTitle(), FontStyle.REGULAR, 18);
titleField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
descriptor.setTitle(titleField.getText());
MercuryStoreUI.adrReloadSubject.onNext(descriptor);
}
});
return titleField;
}
内容来源于网络,如有侵权,请联系作者删除!