Examples of insertString()


Examples of javax.swing.text.AbstractDocument.insertString()

    }

    public void guiTestDocumentSwap() throws Exception {
        final JTextField textField = new JTextField();
        final AbstractDocument documentA = (AbstractDocument) textField.getDocument();
        documentA.insertString(0, "documentA", null);
        final AbstractDocument documentB = new PlainDocument();
        documentB.insertString(0, "documentB", null);

        final int originalDocumentAListenerCount = documentA.getDocumentListeners().length;
        final int originalDocumentBListenerCount = documentB.getDocumentListeners().length;
View Full Code Here

Examples of javax.swing.text.AbstractDocument.insertString()

    public void guiTestDocumentSwap() throws Exception {
        final JTextField textField = new JTextField();
        final AbstractDocument documentA = (AbstractDocument) textField.getDocument();
        documentA.insertString(0, "documentA", null);
        final AbstractDocument documentB = new PlainDocument();
        documentB.insertString(0, "documentB", null);

        final int originalDocumentAListenerCount = documentA.getDocumentListeners().length;
        final int originalDocumentBListenerCount = documentB.getDocumentListeners().length;

        // using the textField in a TextComponentMatcherEditor will install a DocumentListener
View Full Code Here

Examples of javax.swing.text.DefaultStyledDocument.insertString()

        Document doc = new DefaultStyledDocument();
        taArea0.cut();
        // Insert text on the panel
        try {
            for (int i = 0; i < initString.length; i++) {
                doc.insertString(doc.getLength(), initString[i], taArea0
                        .getStyle(initStyles[i]));
            }
            taArea0.setDocument(doc);
        } catch (BadLocationException ble) {
            System.err.println("Couldn't insert initial text.");
View Full Code Here

Examples of javax.swing.text.Document.insertString()

    {
        Document doc = part1.getDocument();
        try
        {
            doc.remove( 0, doc.getLength() );
            doc.insertString( 0, ipString, new SimpleAttributeSet() );
        }
        catch ( BadLocationException exp )
        {
        }
    }
View Full Code Here

Examples of javax.swing.text.Document.insertString()

        nextTF.requestFocus();
        Document doc = nextTF.getDocument();
        try
        {
            doc.remove( 0, doc.getLength() );
            doc.insertString( 0, nextTextFieldStr, new SimpleAttributeSet() );
        }
        catch ( BadLocationException exp )
        {
        }
    }
View Full Code Here

Examples of javax.swing.text.Document.insertString()

         // Checks if the former message should be highlighted in a 'history' color.
         if (document.getLength() >= _lastLength && null != _lastMessage)
      {
            SimpleAttributeSet historySaSet = _saSetHistoryBySaSet.get(_lastSASet);
            document.remove(_lastLength, _lastMessage.length());
            document.insertString(document.getLength(), _lastMessage, historySaSet);
      }
         //
         ///////////////////////////////////////////////////////////////////////////////////

         _lastLength = document.getLength();
View Full Code Here

Examples of javax.swing.text.Document.insertString()

         _lastLength = document.getLength();
      _lastMessage = string;
      _lastSASet = saSet;

      document.insertString(document.getLength(), string, saSet);
    }
    catch (BadLocationException ble)
    {
      s_log.error("Error appending text to MessagePanel document.", ble);
    }
View Full Code Here

Examples of javax.swing.text.Document.insertString()

                    ((PlainDocument) document).replace(p0, p1 - p0, chosedSmileyText, null);
                } else {
                    if (p0 != p1) {
                        document.remove(p0, p1 - p0);
                    }
                    document.insertString(p0, chosedSmileyText, null);
                }
            } catch (final Throwable ble) {
                logger.log(Level.SEVERE, "Problem while pasting text.", ble);
            }
        }
View Full Code Here

Examples of javax.swing.text.Document.insertString()

                    ((PlainDocument) document).replace(p0, p1 - p0, text, null);
                } else {
                    if (p0 != p1) {
                        document.remove(p0, p1 - p0);
                    }
                    document.insertString(p0, text, null);
                }
            } catch (final IOException ioe) {
                logger.log(Level.SEVERE, "Problem while pasting text.", ioe);
            } catch (final UnsupportedFlavorException ufe) {
                logger.log(Level.SEVERE, "Problem while pasting text.", ufe);
View Full Code Here

Examples of javax.swing.text.Document.insertString()

            message = "\n" + message;
        }
        SimpleAttributeSet attr = new SimpleAttributeSet();
        StyleConstants.setForeground(attr, c);
        try {
            doc.insertString(doc.getLength(), message, attr);
        }
        catch(Exception e) {           
        }
        console.setCaretPosition(doc.getLength());
        console.scrollRectToVisible(console.getVisibleRect());
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.