javax.swing
Class JTextPane

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Component sample code for java.awt.Component definition code for java.awt.Component 
      extended by java.awt.Container sample code for java.awt.Container definition code for java.awt.Container 
          extended by javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent 
              extended by javax.swing.text.JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent 
                  extended by javax.swing.JEditorPane sample code for javax.swing.JEditorPane definition code for javax.swing.JEditorPane 
                      extended by javax.swing.JTextPane
All Implemented Interfaces:
ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver , MenuContainer sample code for java.awt.MenuContainer definition code for java.awt.MenuContainer , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible , Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable

public class JTextPane
extends JEditorPane sample code for javax.swing.JEditorPane definition code for javax.swing.JEditorPane

A text component that can be marked up with attributes that are represented graphically. You can find how-to information and examples of using text panes in Using Text Components, a section in The Java Tutorial.

This component models paragraphs that are composed of runs of character level attributes. Each paragraph may have a logical style attached to it which contains the default attributes to use if not overridden by attributes set on the paragraph or character run. Components and images may be embedded in the flow of text.

Newlines
For a discussion on how newlines are handled, see DefaultEditorKit.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
StyledEditorKit sample code for javax.swing.text.StyledEditorKit definition code for javax.swing.text.StyledEditorKit , Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JEditorPane sample code for javax.swing.JEditorPane definition code for javax.swing.JEditorPane
JEditorPane.AccessibleJEditorPane sample code for javax.swing.JEditorPane.AccessibleJEditorPane definition code for javax.swing.JEditorPane.AccessibleJEditorPane , JEditorPane.AccessibleJEditorPaneHTML sample code for javax.swing.JEditorPane.AccessibleJEditorPaneHTML definition code for javax.swing.JEditorPane.AccessibleJEditorPaneHTML , JEditorPane.JEditorPaneAccessibleHypertextSupport sample code for javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport definition code for javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport
 
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
JTextComponent.AccessibleJTextComponent sample code for javax.swing.text.JTextComponent.AccessibleJTextComponent definition code for javax.swing.text.JTextComponent.AccessibleJTextComponent , JTextComponent.KeyBinding sample code for javax.swing.text.JTextComponent.KeyBinding definition code for javax.swing.text.JTextComponent.KeyBinding
 
Nested classes/interfaces inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
JComponent.AccessibleJComponent sample code for javax.swing.JComponent.AccessibleJComponent definition code for javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
Container.AccessibleAWTContainer sample code for java.awt.Container.AccessibleAWTContainer definition code for java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
Component.AccessibleAWTComponent sample code for java.awt.Component.AccessibleAWTComponent definition code for java.awt.Component.AccessibleAWTComponent , Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy definition code for java.awt.Component.BltBufferStrategy , Component.FlipBufferStrategy sample code for java.awt.Component.FlipBufferStrategy definition code for java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JEditorPane sample code for javax.swing.JEditorPane definition code for javax.swing.JEditorPane
HONOR_DISPLAY_PROPERTIES sample code for javax.swing.JEditorPane.HONOR_DISPLAY_PROPERTIES definition code for javax.swing.JEditorPane.HONOR_DISPLAY_PROPERTIES , W3C_LENGTH_UNITS sample code for javax.swing.JEditorPane.W3C_LENGTH_UNITS definition code for javax.swing.JEditorPane.W3C_LENGTH_UNITS
 
Fields inherited from class javax.swing.text.JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
DEFAULT_KEYMAP sample code for javax.swing.text.JTextComponent.DEFAULT_KEYMAP definition code for javax.swing.text.JTextComponent.DEFAULT_KEYMAP , FOCUS_ACCELERATOR_KEY sample code for javax.swing.text.JTextComponent.FOCUS_ACCELERATOR_KEY definition code for javax.swing.text.JTextComponent.FOCUS_ACCELERATOR_KEY
 
Fields inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
accessibleContext sample code for javax.swing.JComponent.accessibleContext definition code for javax.swing.JComponent.accessibleContext , listenerList sample code for javax.swing.JComponent.listenerList definition code for javax.swing.JComponent.listenerList , TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY definition code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY , ui sample code for javax.swing.JComponent.ui definition code for javax.swing.JComponent.ui , UNDEFINED_CONDITION sample code for javax.swing.JComponent.UNDEFINED_CONDITION definition code for javax.swing.JComponent.UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT sample code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT definition code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED sample code for javax.swing.JComponent.WHEN_FOCUSED definition code for javax.swing.JComponent.WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW sample code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW definition code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
BOTTOM_ALIGNMENT sample code for java.awt.Component.BOTTOM_ALIGNMENT definition code for java.awt.Component.BOTTOM_ALIGNMENT , CENTER_ALIGNMENT sample code for java.awt.Component.CENTER_ALIGNMENT definition code for java.awt.Component.CENTER_ALIGNMENT , LEFT_ALIGNMENT sample code for java.awt.Component.LEFT_ALIGNMENT definition code for java.awt.Component.LEFT_ALIGNMENT , RIGHT_ALIGNMENT sample code for java.awt.Component.RIGHT_ALIGNMENT definition code for java.awt.Component.RIGHT_ALIGNMENT , TOP_ALIGNMENT sample code for java.awt.Component.TOP_ALIGNMENT definition code for java.awt.Component.TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver
ABORT sample code for java.awt.image.ImageObserver.ABORT definition code for java.awt.image.ImageObserver.ABORT , ALLBITS sample code for java.awt.image.ImageObserver.ALLBITS definition code for java.awt.image.ImageObserver.ALLBITS , ERROR sample code for java.awt.image.ImageObserver.ERROR definition code for java.awt.image.ImageObserver.ERROR , FRAMEBITS sample code for java.awt.image.ImageObserver.FRAMEBITS definition code for java.awt.image.ImageObserver.FRAMEBITS , HEIGHT sample code for java.awt.image.ImageObserver.HEIGHT definition code for java.awt.image.ImageObserver.HEIGHT , PROPERTIES sample code for java.awt.image.ImageObserver.PROPERTIES definition code for java.awt.image.ImageObserver.PROPERTIES , SOMEBITS sample code for java.awt.image.ImageObserver.SOMEBITS definition code for java.awt.image.ImageObserver.SOMEBITS , WIDTH sample code for java.awt.image.ImageObserver.WIDTH definition code for java.awt.image.ImageObserver.WIDTH
 
Constructor Summary
JTextPane sample code for javax.swing.JTextPane.JTextPane() definition code for javax.swing.JTextPane.JTextPane() ()
          Creates a new JTextPane.
JTextPane sample code for javax.swing.JTextPane.JTextPane(javax.swing.text.StyledDocument) definition code for javax.swing.JTextPane.JTextPane(javax.swing.text.StyledDocument) (StyledDocument sample code for javax.swing.text.StyledDocument definition code for javax.swing.text.StyledDocument  doc)
          Creates a new JTextPane, with a specified document model.
 
Method Summary
 Style sample code for javax.swing.text.Style definition code for javax.swing.text.Style addStyle sample code for javax.swing.JTextPane.addStyle(java.lang.String, javax.swing.text.Style) definition code for javax.swing.JTextPane.addStyle(java.lang.String, javax.swing.text.Style) (String sample code for java.lang.String definition code for java.lang.String  nm, Style sample code for javax.swing.text.Style definition code for javax.swing.text.Style  parent)
          Adds a new style into the logical style hierarchy.
protected  EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit createDefaultEditorKit sample code for javax.swing.JTextPane.createDefaultEditorKit() definition code for javax.swing.JTextPane.createDefaultEditorKit() ()
          Creates the EditorKit to use by default.
 AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet getCharacterAttributes sample code for javax.swing.JTextPane.getCharacterAttributes() definition code for javax.swing.JTextPane.getCharacterAttributes() ()
          Fetches the character attributes in effect at the current location of the caret, or null.
 MutableAttributeSet sample code for javax.swing.text.MutableAttributeSet definition code for javax.swing.text.MutableAttributeSet getInputAttributes sample code for javax.swing.JTextPane.getInputAttributes() definition code for javax.swing.JTextPane.getInputAttributes() ()
          Gets the input attributes for the pane.
 Style sample code for javax.swing.text.Style definition code for javax.swing.text.Style getLogicalStyle sample code for javax.swing.JTextPane.getLogicalStyle() definition code for javax.swing.JTextPane.getLogicalStyle() ()
          Fetches the logical style assigned to the paragraph represented by the current position of the caret, or null.
 AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet getParagraphAttributes sample code for javax.swing.JTextPane.getParagraphAttributes() definition code for javax.swing.JTextPane.getParagraphAttributes() ()
          Fetches the current paragraph attributes in effect at the location of the caret, or null if none.
 Style sample code for javax.swing.text.Style definition code for javax.swing.text.Style getStyle sample code for javax.swing.JTextPane.getStyle(java.lang.String) definition code for javax.swing.JTextPane.getStyle(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  nm)
          Fetches a named non-null style previously added.
 StyledDocument sample code for javax.swing.text.StyledDocument definition code for javax.swing.text.StyledDocument getStyledDocument sample code for javax.swing.JTextPane.getStyledDocument() definition code for javax.swing.JTextPane.getStyledDocument() ()
          Fetches the model associated with the editor.
protected  StyledEditorKit sample code for javax.swing.text.StyledEditorKit definition code for javax.swing.text.StyledEditorKit getStyledEditorKit sample code for javax.swing.JTextPane.getStyledEditorKit() definition code for javax.swing.JTextPane.getStyledEditorKit() ()
          Gets the editor kit.
 String sample code for java.lang.String definition code for java.lang.String getUIClassID sample code for javax.swing.JTextPane.getUIClassID() definition code for javax.swing.JTextPane.getUIClassID() ()
          Returns the class ID for the UI.
 void insertComponent sample code for javax.swing.JTextPane.insertComponent(java.awt.Component) definition code for javax.swing.JTextPane.insertComponent(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Inserts a component into the document as a replacement for the currently selected content.
 void insertIcon sample code for javax.swing.JTextPane.insertIcon(javax.swing.Icon) definition code for javax.swing.JTextPane.insertIcon(javax.swing.Icon) (Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  g)
          Inserts an icon into the document as a replacement for the currently selected content.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for javax.swing.JTextPane.paramString() definition code for javax.swing.JTextPane.paramString() ()
          Returns a string representation of this JTextPane.
 void removeStyle sample code for javax.swing.JTextPane.removeStyle(java.lang.String) definition code for javax.swing.JTextPane.removeStyle(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  nm)
          Removes a named non-null style previously added to the document.
 void replaceSelection sample code for javax.swing.JTextPane.replaceSelection(java.lang.String) definition code for javax.swing.JTextPane.replaceSelection(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  content)
          Replaces the currently selected content with new content represented by the given string.
 void setCharacterAttributes sample code for javax.swing.JTextPane.setCharacterAttributes(javax.swing.text.AttributeSet, boolean) definition code for javax.swing.JTextPane.setCharacterAttributes(javax.swing.text.AttributeSet, boolean) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  attr, boolean replace)
          Applies the given attributes to character content.
 void setDocument sample code for javax.swing.JTextPane.setDocument(javax.swing.text.Document) definition code for javax.swing.JTextPane.setDocument(javax.swing.text.Document) (Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  doc)
          Associates the editor with a text document.
 void setEditorKit sample code for javax.swing.JTextPane.setEditorKit(javax.swing.text.EditorKit) definition code for javax.swing.JTextPane.setEditorKit(javax.swing.text.EditorKit) (EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit  kit)
          Sets the currently installed kit for handling content.
 void setLogicalStyle sample code for javax.swing.JTextPane.setLogicalStyle(javax.swing.text.Style) definition code for javax.swing.JTextPane.setLogicalStyle(javax.swing.text.Style) (Style sample code for javax.swing.text.Style definition code for javax.swing.text.Style  s)
          Sets the logical style to use for the paragraph at the current caret position.
 void setParagraphAttributes sample code for javax.swing.JTextPane.setParagraphAttributes(javax.swing.text.AttributeSet, boolean) definition code for javax.swing.JTextPane.setParagraphAttributes(javax.swing.text.AttributeSet, boolean) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  attr, boolean replace)
          Applies the given attributes to paragraphs.
 void setStyledDocument sample code for javax.swing.JTextPane.setStyledDocument(javax.swing.text.StyledDocument) definition code for javax.swing.JTextPane.setStyledDocument(javax.swing.text.StyledDocument) (StyledDocument sample code for javax.swing.text.StyledDocument definition code for javax.swing.text.StyledDocument  doc)
          Associates the editor with a text document.
 
Methods inherited from class javax.swing.JEditorPane sample code for javax.swing.JEditorPane definition code for javax.swing.JEditorPane
addHyperlinkListener sample code for javax.swing.JEditorPane.addHyperlinkListener(javax.swing.event.HyperlinkListener) definition code for javax.swing.JEditorPane.addHyperlinkListener(javax.swing.event.HyperlinkListener) , createEditorKitForContentType sample code for javax.swing.JEditorPane.createEditorKitForContentType(java.lang.String) definition code for javax.swing.JEditorPane.createEditorKitForContentType(java.lang.String) , fireHyperlinkUpdate sample code for javax.swing.JEditorPane.fireHyperlinkUpdate(javax.swing.event.HyperlinkEvent) definition code for javax.swing.JEditorPane.fireHyperlinkUpdate(javax.swing.event.HyperlinkEvent) , getAccessibleContext sample code for javax.swing.JEditorPane.getAccessibleContext() definition code for javax.swing.JEditorPane.getAccessibleContext() , getContentType sample code for javax.swing.JEditorPane.getContentType() definition code for javax.swing.JEditorPane.getContentType() , getEditorKit sample code for javax.swing.JEditorPane.getEditorKit() definition code for javax.swing.JEditorPane.getEditorKit() , getEditorKitClassNameForContentType sample code for javax.swing.JEditorPane.getEditorKitClassNameForContentType(java.lang.String) definition code for javax.swing.JEditorPane.getEditorKitClassNameForContentType(java.lang.String) , getEditorKitForContentType sample code for javax.swing.JEditorPane.getEditorKitForContentType(java.lang.String) definition code for javax.swing.JEditorPane.getEditorKitForContentType(java.lang.String) , getHyperlinkListeners sample code for javax.swing.JEditorPane.getHyperlinkListeners() definition code for javax.swing.JEditorPane.getHyperlinkListeners() , getPage sample code for javax.swing.JEditorPane.getPage() definition code for javax.swing.JEditorPane.getPage() , getPreferredSize sample code for javax.swing.JEditorPane.getPreferredSize() definition code for javax.swing.JEditorPane.getPreferredSize() , getScrollableTracksViewportHeight sample code for javax.swing.JEditorPane.getScrollableTracksViewportHeight() definition code for javax.swing.JEditorPane.getScrollableTracksViewportHeight() , getScrollableTracksViewportWidth sample code for javax.swing.JEditorPane.getScrollableTracksViewportWidth() definition code for javax.swing.JEditorPane.getScrollableTracksViewportWidth() , getStream sample code for javax.swing.JEditorPane.getStream(java.net.URL) definition code for javax.swing.JEditorPane.getStream(java.net.URL) , getText sample code for javax.swing.JEditorPane.getText() definition code for javax.swing.JEditorPane.getText() , read sample code for javax.swing.JEditorPane.read(java.io.InputStream, java.lang.Object) definition code for javax.swing.JEditorPane.read(java.io.InputStream, java.lang.Object) , registerEditorKitForContentType sample code for javax.swing.JEditorPane.registerEditorKitForContentType(java.lang.String, java.lang.String) definition code for javax.swing.JEditorPane.registerEditorKitForContentType(java.lang.String, java.lang.String) , registerEditorKitForContentType sample code for javax.swing.JEditorPane.registerEditorKitForContentType(java.lang.String, java.lang.String, java.lang.ClassLoader) definition code for javax.swing.JEditorPane.registerEditorKitForContentType(java.lang.String, java.lang.String, java.lang.ClassLoader) , removeHyperlinkListener sample code for javax.swing.JEditorPane.removeHyperlinkListener(javax.swing.event.HyperlinkListener) definition code for javax.swing.JEditorPane.removeHyperlinkListener(javax.swing.event.HyperlinkListener) , scrollToReference sample code for javax.swing.JEditorPane.scrollToReference(java.lang.String) definition code for javax.swing.JEditorPane.scrollToReference(java.lang.String) , setContentType sample code for javax.swing.JEditorPane.setContentType(java.lang.String) definition code for javax.swing.JEditorPane.setContentType(java.lang.String) , setEditorKitForContentType sample code for javax.swing.JEditorPane.setEditorKitForContentType(java.lang.String, javax.swing.text.EditorKit) definition code for javax.swing.JEditorPane.setEditorKitForContentType(java.lang.String, javax.swing.text.EditorKit) , setPage sample code for javax.swing.JEditorPane.setPage(java.lang.String) definition code for javax.swing.JEditorPane.setPage(java.lang.String) , setPage sample code for javax.swing.JEditorPane.setPage(java.net.URL) definition code for javax.swing.JEditorPane.setPage(java.net.URL) , setText sample code for javax.swing.JEditorPane.setText(java.lang.String) definition code for javax.swing.JEditorPane.setText(java.lang.String)
 
Methods inherited from class javax.swing.text.JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
addCaretListener sample code for javax.swing.text.JTextComponent.addCaretListener(javax.swing.event.CaretListener) definition code for javax.swing.text.JTextComponent.addCaretListener(javax.swing.event.CaretListener) , addInputMethodListener sample code for javax.swing.text.JTextComponent.addInputMethodListener(java.awt.event.InputMethodListener) definition code for javax.swing.text.JTextComponent.addInputMethodListener(java.awt.event.InputMethodListener) , addKeymap sample code for javax.swing.text.JTextComponent.addKeymap(java.lang.String, javax.swing.text.Keymap) definition code for javax.swing.text.JTextComponent.addKeymap(java.lang.String, javax.swing.text.Keymap) , copy sample code for javax.swing.text.JTextComponent.copy() definition code for javax.swing.text.JTextComponent.copy() , cut sample code for javax.swing.text.JTextComponent.cut() definition code for javax.swing.text.JTextComponent.cut() , fireCaretUpdate sample code for javax.swing.text.JTextComponent.fireCaretUpdate(javax.swing.event.CaretEvent) definition code for javax.swing.text.JTextComponent.fireCaretUpdate(javax.swing.event.CaretEvent) , getActions sample code for javax.swing.text.JTextComponent.getActions() definition code for javax.swing.text.JTextComponent.getActions() , getCaret sample code for javax.swing.text.JTextComponent.getCaret() definition code for javax.swing.text.JTextComponent.getCaret() , getCaretColor sample code for javax.swing.text.JTextComponent.getCaretColor() definition code for javax.swing.text.JTextComponent.getCaretColor() , getCaretListeners sample code for javax.swing.text.JTextComponent.getCaretListeners() definition code for javax.swing.text.JTextComponent.getCaretListeners() , getCaretPosition sample code for javax.swing.text.JTextComponent.getCaretPosition() definition code for javax.swing.text.JTextComponent.getCaretPosition() , getDisabledTextColor sample code for javax.swing.text.JTextComponent.getDisabledTextColor() definition code for javax.swing.text.JTextComponent.getDisabledTextColor() , getDocument sample code for javax.swing.text.JTextComponent.getDocument() definition code for javax.swing.text.JTextComponent.getDocument() , getDragEnabled sample code for javax.swing.text.JTextComponent.getDragEnabled() definition code for javax.swing.text.JTextComponent.getDragEnabled() , getFocusAccelerator sample code for javax.swing.text.JTextComponent.getFocusAccelerator() definition code for javax.swing.text.JTextComponent.getFocusAccelerator() , getHighlighter sample code for javax.swing.text.JTextComponent.getHighlighter() definition code for javax.swing.text.JTextComponent.getHighlighter() , getInputMethodRequests sample code for javax.swing.text.JTextComponent.getInputMethodRequests() definition code for javax.swing.text.JTextComponent.getInputMethodRequests() , getKeymap sample code for javax.swing.text.JTextComponent.getKeymap() definition code for javax.swing.text.JTextComponent.getKeymap() , getKeymap sample code for javax.swing.text.JTextComponent.getKeymap(java.lang.String) definition code for javax.swing.text.JTextComponent.getKeymap(java.lang.String) , getMargin sample code for javax.swing.text.JTextComponent.getMargin() definition code for javax.swing.text.JTextComponent.getMargin() , getNavigationFilter sample code for javax.swing.text.JTextComponent.getNavigationFilter() definition code for javax.swing.text.JTextComponent.getNavigationFilter() , getPreferredScrollableViewportSize sample code for javax.swing.text.JTextComponent.getPreferredScrollableViewportSize() definition code for javax.swing.text.JTextComponent.getPreferredScrollableViewportSize() , getScrollableBlockIncrement sample code for javax.swing.text.JTextComponent.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.text.JTextComponent.getScrollableBlockIncrement(java.awt.Rectangle, int, int) , getScrollableUnitIncrement