本文整理了Java中javax.swing.JTextField.addKeyListener()
方法的一些代码示例,展示了JTextField.addKeyListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.addKeyListener()
方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:addKeyListener
暂无
代码示例来源:origin: runelite/runelite
@Override
public void addKeyListener(KeyListener keyListener)
{
textField.addKeyListener(keyListener);
}
代码示例来源:origin: JetBrains/ideavim
public void setEntryKeyListener(@NotNull KeyListener listener) {
myEntry.addKeyListener(listener);
}
代码示例来源: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 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 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: skylot/jadx
contentPane.add(buttonPane, BorderLayout.PAGE_END);
searchField.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
代码示例来源:origin: skylot/jadx
searchField.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
代码示例来源:origin: geotools/geotools
public void removeListener(Controller controller) {
text.addKeyListener(controller);
}
代码示例来源:origin: geotools/geotools
public void addListener(Controller controller) {
text.addKeyListener(controller);
}
代码示例来源:origin: winder/Universal-G-Code-Sender
private JTextField createMacroField(int index, MACRO_FIELD f, String text) {
JTextField textField = new JTextField(text);
textField.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
update(index, f, textField.getText());
}
@Override
public void keyPressed(KeyEvent e) {
update(index, f, textField.getText());
}
@Override
public void keyReleased(KeyEvent e) {
update(index, f, textField.getText());
}
});
return textField;
}
代码示例来源:origin: magefree/mage
txtMessage.setName(""); // NOI18N
txtMessage.setPreferredSize(new java.awt.Dimension(6, 70));
txtMessage.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
txtMessageKeyTyped(evt);
代码示例来源:origin: magefree/mage
lblPort.setText("Port:");
txtPort.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
ConnectDialog.this.keyTyped(evt);
lblProxyPort.setText("Port:");
txtProxyPort.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
txtProxyPortkeyTyped(evt);
代码示例来源:origin: nodebox/nodebox
searchField.putClientProperty("JTextField.variant", "search");
EscapeListener escapeListener = new EscapeListener();
searchField.addKeyListener(escapeListener);
ArrowKeysListener arrowKeysListener = new ArrowKeysListener();
searchField.addKeyListener(arrowKeysListener);
SearchFieldChangeListener searchFieldChangeListener = new SearchFieldChangeListener();
searchField.getDocument().addDocumentListener(searchFieldChangeListener);
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
this.textIndex.addKeyListener(new KeyAdapter() {
private String allowedRegex = "[^0-9]";
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
this.textIndex.addKeyListener(new KeyAdapter() {
private String allowedRegex = "[^0-9]";
代码示例来源:origin: pengwei1024/AndroidSourceViewer
/**
* @param keyword searchBar
* @param result 搜索结果回调
*/
public GlobalSearchDialog(String keyword, SearchFinishResult result) {
setContentPane(contentPane);
setModal(true);
setTitle("Android Source Search");
setSize(800, 500);
this.setLocationRelativeTo(null);
listView.setModel(dataSet);
listView.setFixedCellHeight(25);
listView.addListSelectionListener(this);
listView.addMouseListener(new ListDoubleClickEvent<String>(this));
searchBar.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
startSearch();
}
});
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.searchFinishResult = result;
if (!Utils.isEmpty(keyword)) {
searchBar.setText(keyword);
startSearch();
}
}
代码示例来源:origin: ron190/jsql-injection
this.textFieldEditable.addKeyListener(keyAdapterF2);
代码示例来源:origin: nodebox/nodebox
numberField.setHorizontalAlignment(JTextField.CENTER);
numberField.setVisible(false);
numberField.addKeyListener(new EscapeListener());
numberField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
代码示例来源:origin: magefree/mage
editSearch.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
代码示例来源:origin: magefree/mage
editSearch.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
内容来源于网络,如有侵权,请联系作者删除!