Java Swing - O Reilly 20.1.14 The AbstractDocument.Content Interface
Java Swing - O Reilly 20.1.14 The AbstractDocument.Content Interface This interface is used to represent a sequence of data that may be edited. This is where an AbstractDocument actually stores its content. Many of the methods in AbstractDocument simply delegate the call to the document’s Content object. 20.1.14.1 Methods public abstract Position createPosition(int offset) throws BadLocationException Creates a Position that will track changes at the specified offset. public abstract void getChars(int where, int len, Segment txt) throws BadLocationException Returns the specified range of text. The result is passed back in the input Segment object. public abstract String getString(int where, int len) throws BadLocationException Returns a String containing the specified range of text. public abstract UndoableEdit insertString(int where, String str)throws BadLocationException Inserts the specified string at the requested offset in the content. If the Content implementation supports undo, an UndoableEdit object will be returned; otherwise this method returns null. public abstract int length() Returns the current length of the content. public abstract UndoableEdit remove(int where, int nitems) throws BadLocationException Removes the specified number of items (characters, icons, or components) from the document content. If the Content implementation supports undo, an UndoableEdit object will be returned, otherwise this method returns null. 20.1.15 The StringContent Class This is a basic implementation of the AbstractDocument.Content interface. At present, this is the implementation used by all of the Swing text components, though there may be a change to the newer GapContent class in a later release. The content is stored in a character array, and changes are made by modifying the array’s contents and copying the array when necessary to support growth. StringContent supports undoable edits, so the insertString() and remove() methods always return non-null UndoableEdit objects. 20.1.15.1 Constructors public StringContent() - 637
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.