Java Swing - O Reilly Creates an array sized (Web design programs)

Java Swing - O Reilly Creates an array sized to hold a default (10) number of characters, initially containing a single newline character. public StringContent(int initialLength) Creates an array of the specified size, initially containing a single newline character. 20.1.15.2 Public Methods public Position createPosition(int offset) throws BadLocationException Creates a Position that will track changes at the specified offset. This is done by keeping a Vector of “marks,” which are updated each time content is inserted or removed. The returned Position is of type StringContent.StickyPosition (a non-public inner class). public void getChars(int where, int len, Segment txt) throws BadLocationException Returns the specified range of text. The entire data array is returned in the Segment with the specified offset and length set. public String getString(int where, int len) throws BadLocationException Creates and returns a new String containing the specified range of text. public UndoableEdit insertString(int where, String str) throws BadLocationException Inserts the specified string at the requested offset in the content. If necessary, the array size is increased (by doubling, or by adding the size of the new string, whichever is larger) to accommodate the new text. All of the Positions previously created by createPosition() calls are updated to reflect the newly added text. An UndoableEdit (a non-public inner class called InsertUndo) is returned, which allows this insert to be undone. public int length() Returns the current length of the content. This is the number of characters in the array, not the total allocated size of the array. public UndoableEdit remove(int where, int nitems) throws BadLocationException Removes the specified number of characters from the content by copying the appropriate segments of the array. All of the Positions previously created by createPosition() calls are updated to reflect the removed text. An UndoableEdit (a non-public inner class called RemoveUndo) is returned, which allows this removal to be undone. 20.1.15.3 Protected Methods The following methods are used by the non-public undoable edit inner classes to provide undo support. protected Vector getPositionsInRange(Vector v, int offset, int length) - 638
Check Tomcat Web Hosting services for best quality webspace to host your web application.

Leave a Reply