本文整理了Java中javax.swing.text.JTextComponent.selectAll()
方法的一些代码示例,展示了JTextComponent.selectAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.selectAll()
方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:selectAll
暂无
代码示例来源:origin: skylot/jadx
@Override
public void actionPerformed(ActionEvent ae) {
textComponent.selectAll();
}
};
代码示例来源:origin: deathmarine/Luyten
public void focusGained(FocusEvent e) {
textComponent.selectAll();
}
代码示例来源:origin: RipMeApp/ripme
@Override
public void actionPerformed(ActionEvent ae) {
lastActionSelected = Actions.SELECT_ALL;
textComponent.selectAll();
}
};
代码示例来源:origin: deathmarine/Luyten
public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting() == false) {
JList<?> list = (JList<?>) e.getSource();
String selectedValue = (String) list.getSelectedValue();
String oldValue = textComponent.getText();
textComponent.setText(selectedValue);
if (!oldValue.equalsIgnoreCase(selectedValue)) {
textComponent.selectAll();
textComponent.requestFocus();
}
updateSampleFont();
}
}
}
代码示例来源:origin: stackoverflow.com
public void actionPerformed(ActionEvent ae) {
lastActionSelected = Actions.SELECT_ALL;
textComponent.selectAll();
代码示例来源:origin: stackoverflow.com
} else {
textField.selectAll();
JOptionPane.showMessageDialog(this,
"Sorry, \"" + typedText + "\" "
代码示例来源:origin: stackoverflow.com
public void open() {
setVisible(true);
jTextField1.selectAll();
jTextField1.requestFocus();
public void userRejected() {
jLabel1.setText("Try again!");
jTextField1.selectAll();
jTextField1.requestFocus();
代码示例来源:origin: stackoverflow.com
ta.insert(pad, ta.getCaretPosition());
else if (choice == selectI)
ta.selectAll();
else if (e.getSource() == statusI)
代码示例来源:origin: stackoverflow.com
((JTextComponent) editor).selectAll();
((JTextComponent) editor).selectAll();
代码示例来源:origin: nativelibs4java/JNAerator
@Override
public void focusGained(FocusEvent arg0) {
jtc.selectAll();
}
@Override
代码示例来源:origin: atarw/material-ui-swing
@Override
public void actionPerformed (ActionEvent e) {
getComponent ().selectAll ();
}
};
代码示例来源:origin: com.googlecode.vfsjfilechooser2/vfsjfilechooser2
public void actionPerformed(ActionEvent e)
{
txt.selectAll();
}
});
代码示例来源:origin: stackoverflow.com
class SelectAll extends TextAction
{
public SelectAll()
{
super("Select All");
}
public void actionPerformed(ActionEvent e)
{
JTextComponent component = getFocusedComponent();
component.selectAll();
}
}
代码示例来源:origin: igniterealtime/Spark
public void focusGained(FocusEvent e) {
Object o = e.getSource();
if (o instanceof JTextComponent) {
((JTextComponent)o).selectAll();
}
}
代码示例来源:origin: stackoverflow.com
private class MyFocusListener extends FocusAdapter {
@Override
public void focusGained(FocusEvent fEvt) {
JTextComponent component = (JTextComponent) fEvt.getSource();
component.selectAll();
}
}
代码示例来源:origin: freeplane/freeplane
@Override
public void focusGained(FocusEvent e) {
((JTextComponent) e.getComponent()).selectAll();
}
};
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial
public void refreshUrlHistory() {
repositoryPanel.urlComboBox.setModel(
new DefaultComboBoxModel(createPresetComboEntries()));
urlComboEditor.selectAll();
}
代码示例来源:origin: jfree/jcommon
/**
* Selects all the text when a field gains the focus.
*
* @param e the focus event.
*/
public void focusGained(final FocusEvent e) {
if (e.getSource() instanceof JTextComponent) {
final JTextComponent tex = (JTextComponent) e.getSource();
tex.selectAll();
}
}
代码示例来源:origin: org.jfree/com.springsource.org.jfree
/**
* Selects all the text when a field gains the focus.
*
* @param e the focus event.
*/
public void focusGained(final FocusEvent e) {
if (e.getSource() instanceof JTextComponent) {
final JTextComponent tex = (JTextComponent) e.getSource();
tex.selectAll();
}
}
代码示例来源:origin: freeplane/freeplane
public void focusInputField(final boolean selectAll) {
if (values.isEnabled()) {
values.requestFocus();
final Component editorComponent = values.getEditor().getEditorComponent();
if (selectAll && editorComponent instanceof JTextComponent) {
((JTextComponent) editorComponent).selectAll();
}
return;
}
}
内容来源于网络,如有侵权,请联系作者删除!