Package javax.swing.text

Examples of javax.swing.text.JTextComponent.replaceSelection()


          final String newWord = sugestionWord;
          item.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
              jText.setSelectionStart(begOffs);
              jText.setSelectionEnd(endOffs);
              jText.replaceSelection(newWord);
            }
          });
        }
        final UserDictionaryProvider provider = SpellChecker.getUserDictionaryProvider();
        if (provider == null) {
View Full Code Here


      }
      final Component mostRecentFocusOwner = parentWindow.getMostRecentFocusOwner();
    if (mostRecentFocusOwner instanceof JTextComponent
            && !(mostRecentFocusOwner.getClass().getName().contains("JSpinField"))) {
        final JTextComponent textComponent = (JTextComponent) mostRecentFocusOwner;
        textComponent.replaceSelection(dateAsString);
        return;
      }
      if(mostRecentFocusOwner instanceof JTable){
        JTable table = (JTable) mostRecentFocusOwner;
        final int[] selectedRows = table.getSelectedRows();
View Full Code Here

            textComponent.copy();
        } else if (e.getSource() == pasteItem) {
            textComponent.paste();
        } else if (e.getSource() == deleteItem) {
            if (!haveSelection) textComponent.selectAll();
            textComponent.replaceSelection("");
        } else if (e.getSource() == selectAllItem) {
            textComponent.selectAll();
        }
    }
}
View Full Code Here

            textComponent.copy();
        } else if (e.getSource() == pasteItem) {
            textComponent.paste();
        } else if (e.getSource() == deleteItem) {
            if (!haveSelection) textComponent.selectAll();
            textComponent.replaceSelection("");
        } else if (e.getSource() == selectAllItem) {
            textComponent.selectAll();
        }
    }
}
View Full Code Here

            }
            catch (java.io.IOException e) {
                return false;
            }
            JTextComponent tc = (JTextComponent) comp;
            tc.replaceSelection(data);
            insertDone = true;
        }
        return insertDone;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.