javax.swing
Class JEditorPane

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
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
Direct Known Subclasses:
JTextPane sample code for javax.swing.JTextPane definition code for javax.swing.JTextPane

public class JEditorPane
extends JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent

A text component to edit various kinds of content. You can find how-to information and examples of using editor panes in Using Text Components, a section in The Java Tutorial.

This component uses implementations of the EditorKit to accomplish its behavior. It effectively morphs into the proper kind of text editor for the kind of content it is given. The content type that editor is bound to at any given time is determined by the EditorKit currently installed. If the content is set to a new URL, its type is used to determine the EditorKit that should be used to load the content.

By default, the following types of content are known:

text/plain
Plain text, which is the default the type given isn't recognized. The kit used in this case is an extension of DefaultEditorKit that produces a wrapped plain text view.
text/html
HTML text. The kit used in this case is the class javax.swing.text.html.HTMLEditorKit which provides HTML 3.2 support.
text/rtf
RTF text. The kit used in this case is the class javax.swing.text.rtf.RTFEditorKit which provides a limited support of the Rich Text Format.

There are several ways to load content into this component.

  1. The setText method can be used to initialize the component from a string. In this case the current EditorKit will be used, and the content type will be expected to be of this type.
  2. The read method can be used to initialize the component from a Reader. Note that if the content type is HTML, relative references (e.g. for things like images) can't be resolved unless the <base> tag is used or the Base property on HTMLDocument is set. In this case the current EditorKit will be used, and the content type will be expected to be of this type.
  3. The setPage method can be used to initialize the component from a URL. In this case, the content type will be determined from the URL, and the registered EditorKit for that content type will be set.

Some kinds of content may provide hyperlink support by generating hyperlink events. The HTML EditorKit will generate hyperlink events if the JEditorPane is not editable (JEditorPane.setEditable(false); has been called). If HTML frames are embedded in the document, the typical response would be to change a portion of the current document. The following code fragment is a possible hyperlink listener implementation, that treats HTML frame events specially, and simply displays any other activated hyperlinks.


     class Hyperactive implements HyperlinkListener {
 
         public void hyperlinkUpdate(HyperlinkEvent e) {
             if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                 JEditorPane pane = (JEditorPane) e.getSource();
                 if (e instanceof HTMLFrameHyperlinkEvent) {
                     HTMLFrameHyperlinkEvent  evt = (HTMLFrameHyperlinkEvent)e;
                     HTMLDocument doc = (HTMLDocument)pane.getDocument();
                     doc.processHTMLFrameHyperlinkEvent(evt);
                 } else {
                     try {
                         pane.setPage(e.getURL());
                     } catch (Throwable t) {
                         t.printStackTrace();
                     }
                 }
             }
         }
     }

 

For information on customizing how text/html is rendered please see W3C_LENGTH_UNITS sample code for javax.swing.JEditorPane.W3C_LENGTH_UNITS definition code for javax.swing.JEditorPane.W3C_LENGTH_UNITS and HONOR_DISPLAY_PROPERTIES sample code for javax.swing.JEditorPane.HONOR_DISPLAY_PROPERTIES definition code for javax.swing.JEditorPane.HONOR_DISPLAY_PROPERTIES

Culturally dependent information in some documents is handled through a mechanism called character encoding. Character encoding is an unambiguous mapping of the members of a character set (letters, ideographs, digits, symbols, or control functions) to specific numeric code values. It represents the way the file is stored. Example character encodings are ISO-8859-1, ISO-8859-5, Shift-jis, Euc-jp, and UTF-8. When the file is passed to an user agent (JEditorPane) it is converted to the document character set (ISO-10646 aka Unicode).

There are multiple ways to get a character set mapping to happen with JEditorPane.

  1. One way is to specify the character set as a parameter of the MIME type. This will be established by a call to the setContentType method. If the content is loaded by the setPage method the content type will have been set according to the specification of the URL. It the file is loaded directly, the content type would be expected to have been set prior to loading.
  2. Another way the character set can be specified is in the document itself. This requires reading the document prior to determining the character set that is desired. To handle this, it is expected that the EditorKit.read operation throw a ChangedCharSetException which will be caught. The read is then restarted with a new Reader that uses the character set specified in the ChangedCharSetException (which is an IOException).

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:
Serialized Form

Nested Class Summary
protected  class JEditorPane.AccessibleJEditorPane sample code for javax.swing.JEditorPane.AccessibleJEditorPane definition code for javax.swing.JEditorPane.AccessibleJEditorPane
          This class implements accessibility support for the JEditorPane class.
protected  class JEditorPane.AccessibleJEditorPaneHTML sample code for javax.swing.JEditorPane.AccessibleJEditorPaneHTML definition code for javax.swing.JEditorPane.AccessibleJEditorPaneHTML
          This class provides support for AccessibleHypertext, and is used in instances where the EditorKit installed in this JEditorPane is an instance of HTMLEditorKit.
protected  class JEditorPane.JEditorPaneAccessibleHypertextSupport sample code for javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport definition code for javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport
          What's returned by AccessibleJEditorPaneHTML.getAccessibleText.
 
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
static String sample code for java.lang.String definition code for java.lang.String HONOR_DISPLAY_PROPERTIES sample code for javax.swing.JEditorPane.HONOR_DISPLAY_PROPERTIES definition code for javax.swing.JEditorPane.HONOR_DISPLAY_PROPERTIES
          Key for a client property used to indicate whether the default font and foreground color from the component are used if a font or foreground color is not specified in the styled text.
static String sample code for java.lang.String definition code for java.lang.String W3C_LENGTH_UNITS sample code for javax.swing.JEditorPane.W3C_LENGTH_UNITS definition code for javax.swing.JEditorPane.W3C_LENGTH_UNITS
          Key for a client property used to indicate whether w3c compliant length units are used for html rendering.
 
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
JEditorPane sample code for javax.swing.JEditorPane.JEditorPane() definition code for javax.swing.JEditorPane.JEditorPane() ()
          Creates a new JEditorPane.
JEditorPane sample code for javax.swing.JEditorPane.JEditorPane(java.lang.String) definition code for javax.swing.JEditorPane.JEditorPane(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  url)
          Creates a JEditorPane based on a string containing a URL specification.
JEditorPane sample code for javax.swing.JEditorPane.JEditorPane(java.lang.String, java.lang.String) definition code for javax.swing.JEditorPane.JEditorPane(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  type, String sample code for java.lang.String definition code for java.lang.String  text)
          Creates a JEditorPane that has been initialized to the given text.
JEditorPane sample code for javax.swing.JEditorPane.JEditorPane(java.net.URL) definition code for javax.swing.JEditorPane.JEditorPane(java.net.URL) (URL sample code for java.net.URL definition code for java.net.URL  initialPage)
          Creates a JEditorPane based on a specified URL for input.
 
Method Summary
 void addHyperlinkListener sample code for javax.swing.JEditorPane.addHyperlinkListener(javax.swing.event.HyperlinkListener) definition code for javax.swing.JEditorPane.addHyperlinkListener(javax.swing.event.HyperlinkListener) (HyperlinkListener sample code for javax.swing.event.HyperlinkListener definition code for javax.swing.event.HyperlinkListener  listener)
          Adds a hyperlink listener for notification of any changes, for example when a link is selected and entered.
protected  EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit createDefaultEditorKit sample code for javax.swing.JEditorPane.createDefaultEditorKit() definition code for javax.swing.JEditorPane.createDefaultEditorKit() ()
          Creates the default editor kit (PlainEditorKit) for when the component is first created.
static EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit createEditorKitForContentType sample code for javax.swing.JEditorPane.createEditorKitForContentType(java.lang.String) definition code for javax.swing.JEditorPane.createEditorKitForContentType(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  type)
          Creates a handler for the given type from the default registry of editor kits.
 void fireHyperlinkUpdate sample code for javax.swing.JEditorPane.fireHyperlinkUpdate(javax.swing.event.HyperlinkEvent) definition code for javax.swing.JEditorPane.fireHyperlinkUpdate(javax.swing.event.HyperlinkEvent) (HyperlinkEvent sample code for javax.swing.event.HyperlinkEvent definition code for javax.swing.event.HyperlinkEvent  e)
          Notifies all listeners that have registered interest for notification on this event type.
 AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext getAccessibleContext sample code for javax.swing.JEditorPane.getAccessibleContext() definition code for javax.swing.JEditorPane.getAccessibleContext() ()
          Gets the AccessibleContext associated with this JEditorPane.
 String sample code for java.lang.String definition code for java.lang.String getContentType sample code for javax.swing.JEditorPane.getContentType() definition code for javax.swing.JEditorPane.getContentType() ()
          Gets the type of content that this editor is currently set to deal with.
 EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit getEditorKit sample code for javax.swing.JEditorPane.getEditorKit() definition code for javax.swing.JEditorPane.getEditorKit() ()
          Fetches the currently installed kit for handling content.
static String sample code for java.lang.String definition code for java.lang.String getEditorKitClassNameForContentType sample code for javax.swing.JEditorPane.getEditorKitClassNameForContentType(java.lang.String) definition code for javax.swing.JEditorPane.getEditorKitClassNameForContentType(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  type)
          Returns the currently registered EditorKit class name for the type type.
 EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit getEditorKitForContentType sample code for javax.swing.JEditorPane.getEditorKitForContentType(java.lang.String) definition code for javax.swing.JEditorPane.getEditorKitForContentType(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  type)
          Fetches the editor kit to use for the given type of content.
 HyperlinkListener sample code for javax.swing.event.HyperlinkListener definition code for javax.swing.event.HyperlinkListener [] getHyperlinkListeners sample code for javax.swing.JEditorPane.getHyperlinkListeners() definition code for javax.swing.JEditorPane.getHyperlinkListeners() ()
          Returns an array of all the HyperLinkListeners added to this JEditorPane with addHyperlinkListener().
 URL sample code for java.net.URL definition code for java.net.URL getPage sample code for javax.swing.JEditorPane.getPage() definition code for javax.swing.JEditorPane.getPage() ()
          Gets the current URL being displayed.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getPreferredSize sample code for javax.swing.JEditorPane.getPreferredSize() definition code for javax.swing.JEditorPane.getPreferredSize() ()
          Returns the preferred size for the JEditorPane.
 boolean getScrollableTracksViewportHeight sample code for javax.swing.JEditorPane.getScrollableTracksViewportHeight() definition code for javax.swing.JEditorPane.getScrollableTracksViewportHeight() ()
          Returns true if a viewport should always force the height of this Scrollable to match the height of the viewport.
 boolean getScrollableTracksViewportWidth sample code for javax.swing.JEditorPane.getScrollableTracksViewportWidth() definition code for javax.swing.JEditorPane.getScrollableTracksViewportWidth() ()
          Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport.
protected  InputStream sample code for java.io.InputStream definition code for java.io.InputStream getStream sample code for javax.swing.JEditorPane.getStream(java.net.URL) definition code for javax.swing.JEditorPane.getStream(java.net.URL) (URL sample code for java.net.URL definition code for java.net.URL  page)
          Fetches a stream for the given URL, which is about to be loaded by the setPage method.
 String sample code for java.lang.String definition code for java.lang.String getText sample code for javax.swing.JEditorPane.getText() definition code for javax.swing.JEditorPane.getText() ()
          Returns the text contained in this TextComponent in terms of the content type of this editor.
 String sample code for java.lang.String definition code for java.lang.String getUIClassID sample code for javax.swing.JEditorPane.getUIClassID() definition code for javax.swing.JEditorPane.getUIClassID() ()
          Gets the class ID for the UI.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for javax.swing.JEditorPane.paramString() definition code for javax.swing.JEditorPane.paramString() ()
          Returns a string representation of this JEditorPane.
 void 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) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  in, Object sample code for java.lang.Object definition code for java.lang.Object  desc)
          This method initializes from a stream.
static void 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) (String sample code for java.lang.String definition code for java.lang.String  type, String sample code for java.lang.String definition code for java.lang.String  classname)
          Establishes the default bindings of type to classname.
static void 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) (String sample code for java.lang.String definition code for java.lang.String  type, String sample code for java.lang.String definition code for java.lang.String  classname, ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  loader)
          Establishes the default bindings of type to classname.
 void removeHyperlinkListener sample code for javax.swing.JEditorPane.removeHyperlinkListener(javax.swing.event.HyperlinkListener) definition code for javax.swing.JEditorPane.removeHyperlinkListener(javax.swing.event.HyperlinkListener) (HyperlinkListener sample code for javax.swing.event.HyperlinkListener definition code for javax.swing.event.HyperlinkListener  listener)
          Removes a hyperlink listener.
 void replaceSelection sample code for javax.swing.JEditorPane.replaceSelection(java.lang.String) definition code for javax.swing.JEditorPane.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 scrollToReference sample code for javax.swing.JEditorPane.scrollToReference(java.lang.String) definition code for javax.swing.JEditorPane.scrollToReference(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  reference)
          Scrolls the view to the given reference location (that is, the value returned by the UL.getRef method for the URL being displayed).
 void setContentType sample code for javax.swing.JEditorPane.setContentType(java.lang.String) definition code for javax.swing.JEditorPane.setContentType(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  type)
          Sets the type of content that this editor handles.
 void setEditorKit sample code for javax.swing.JEditorPane.setEditorKit(javax.swing.text.EditorKit) definition code for javax.swing.JEditorPane.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 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) (String sample code for java.lang.String definition code for java.lang.String  type, EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit  k)
          Directly sets the editor kit to use for the given type.
 void setPage sample code for javax.swing.JEditorPane.setPage(java.lang.String) definition code for javax.swing.JEditorPane.setPage(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  url)
          Sets the current URL being displayed.
 void setPage sample code for javax.swing.JEditorPane.setPage(java.net.URL) definition code for javax.swing.JEditorPane.setPage(java.net.URL) (URL sample code for java.net.URL definition code for java.net.URL  page)
          Sets the current URL being displayed.
 void setText sample code for javax.swing.JEditorPane.setText(java.lang.String) definition code for javax.swing.JEditorPane.setText(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  t)
          Sets the text of this TextComponent to the specified content, which is expected to be in the format of the content type of this editor.
 
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 sample code for javax.swing.text.JTextComponent.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.text.JTextComponent.getScrollableUnitIncrement(java.awt.Rectangle, int, int) , getSelectedText sample code for javax.swing.text.JTextComponent.getSelectedText() definition code for javax.swing.text.JTextComponent.getSelectedText() , getSelectedTextColor sample code for javax.swing.text.JTextComponent.getSelectedTextColor() definition code for javax.swing.text.JTextComponent.getSelectedTextColor() , getSelectionColor sample code for javax.swing.text.JTextComponent.getSelectionColor() definition code for javax.swing.text.JTextComponent.getSelectionColor() , getSelectionEnd sample code for javax.swing.text.JTextComponent.getSelectionEnd() definition code for javax.swing.text.JTextComponent.getSelectionEnd() , getSelectionStart sample code for javax.swing.text.JTextComponent.getSelectionStart() definition code for javax.swing.text.JTextComponent.getSelectionStart() , getText sample code for javax.swing.text.JTextComponent.getText(int, int) definition code for javax.swing.text.JTextComponent.getText(int, int) , getToolTipText sample code for javax.swing.text.JTextComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.text.JTextComponent.getToolTipText(java.awt.event.MouseEvent) , getUI sample code for javax.swing.text.JTextComponent.getUI() definition code for javax.swing.text.JTextComponent.getUI() , isEditable sample code for javax.swing.text.JTextComponent.isEditable() definition code for javax.swing.text.JTextComponent.isEditable() , loadKeymap sample code for javax.swing.text.JTextComponent.loadKeymap(javax.swing.text.Keymap, javax.swing.text.JTextComponent.KeyBinding[], javax.swing.Action[]) definition code for javax.swing.text.JTextComponent.loadKeymap(javax.swing.text.Keymap, javax.swing.text.JTextComponent.KeyBinding[], javax.swing.Action[]) , modelToView sample code for javax.swing.text.JTextComponent.modelToView(int) definition code for javax.swing.text.JTextComponent.modelToView(int) , moveCaretPosition sample code for javax.swing.text.JTextComponent.moveCaretPosition(int) definition code for javax.swing.text.JTextComponent.moveCaretPosition(int) , paste sample code for javax.swing.text.JTextComponent.paste() definition code for javax.swing.text.JTextComponent.paste() , processInputMethodEvent sample code for javax.swing.text.JTextComponent.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for javax.swing.text.JTextComponent.processInputMethodEvent(java.awt.event.InputMethodEvent) , read sample code for javax.swing.text.JTextComponent.read(java.io.Reader, java.lang.Object) definition code for javax.swing.text.JTextComponent.read(java.io.Reader, java.lang.Object) , removeCaretListener sample code for javax.swing.text.JTextComponent.removeCaretListener(javax.swing.event.CaretListener) definition code for javax.swing.text.JTextComponent.removeCaretListener(javax.swing.event.CaretListener) , removeKeymap sample code for javax.swing.text.JTextComponent.removeKeymap(java.lang.String) definition code for javax.swing.text.JTextComponent.removeKeymap(java.lang.String) , removeNotify sample code for javax.swing.text.JTextComponent.removeNotify() definition code for javax.swing.text.JTextComponent.removeNotify() , select sample code for javax.swing.text.JTextComponent.select(int, int) definition code for javax.swing.text.JTextComponent.select(int, int) , selectAll sample code for javax.swing.text.JTextComponent.selectAll() definition code for javax.swing.text.JTextComponent.selectAll() , setCaret sample code for javax.swing.text.JTextComponent.setCaret(javax.swing.text.Caret) definition code for javax.swing.text.JTextComponent.setCaret(javax.swing.text.Caret) , setCaretColor sample code for javax.swing.text.JTextComponent.setCaretColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setCaretColor(java.awt.Color) , setCaretPosition sample code for javax.swing.text.JTextComponent.setCaretPosition(int) definition code for javax.swing.text.JTextComponent.setCaretPosition(int) , setComponentOrientation sample code for javax.swing.text.JTextComponent.setComponentOrientation(java.awt.ComponentOrientation) definition code for javax.swing.text.JTextComponent.setComponentOrientation(java.awt.ComponentOrientation) , setDisabledTextColor sample code for javax.swing.text.JTextComponent.setDisabledTextColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setDisabledTextColor(java.awt.Color) , setDocument sample code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document) definition code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document) , setDragEnabled sample code for javax.swing.text.JTextComponent.setDragEnabled(boolean) definition code for javax.swing.text.JTextComponent.setDragEnabled(boolean) , setEditable sample code for javax.swing.text.JTextComponent.setEditable(boolean) definition code for javax.swing.text.JTextComponent.setEditable(boolean) , setFocusAccelerator sample code for javax.swing.text.JTextComponent.setFocusAccelerator(char) definition code for javax.swing.text.JTextComponent.setFocusAccelerator(char) , setHighlighter sample code for javax.swing.text.JTextComponent.setHighlighter(javax.swing.text.Highlighter) definition code for javax.swing.text.JTextComponent.setHighlighter(javax.swing.text.Highlighter) , setKeymap sample code for javax.swing.text.JTextComponent.setKeymap(javax.swing.text.Keymap) definition code for javax.swing.text.JTextComponent.setKeymap(javax.swing.text.Keymap) , setMargin sample code for javax.swing.text.JTextComponent.setMargin(java.awt.Insets) definition code for javax.swing.text.JTextComponent.setMargin(java.awt.Insets) , setNavigationFilter sample code for javax.swing.text.JTextComponent.setNavigationFilter(javax.swing.text.NavigationFilter) definition code for javax.swing.text.JTextComponent.setNavigationFilter(javax.swing.text.NavigationFilter) , setSelectedTextColor sample code for javax.swing.text.JTextComponent.setSelectedTextColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setSelectedTextColor(java.awt.Color) , setSelectionColor sample code for javax.swing.text.JTextComponent.setSelectionColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setSelectionColor(java.awt.Color) , setSelectionEnd sample code for javax.swing.text.JTextComponent.setSelectionEnd(int) definition code for javax.swing.text.JTextComponent.setSelectionEnd(int) , setSelectionStart sample code for javax.swing.text.JTextComponent.setSelectionStart(int) definition code for javax.swing.text.JTextComponent.setSelectionStart(int) , setUI sample code for javax.swing.text.JTextComponent.setUI(javax.swing.plaf.TextUI) definition code for javax.swing.text.JTextComponent.setUI(javax.swing.plaf.TextUI) , updateUI sample code for javax.swing.text.JTextComponent.updateUI() definition code for javax.swing.text.JTextComponent.updateUI() , viewToModel sample code for javax.swing.text.JTextComponent.viewToModel(java.awt.Point) definition code for javax.swing.text.JTextComponent.viewToModel(java.awt.Point) , write sample code for javax.swing.text.JTextComponent.write(java.io.Writer) definition code for javax.swing.text.JTextComponent.write(java.io.Writer)
 
Methods inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
addAncestorListener sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) , addNotify sample code for javax.swing.JComponent.addNotify() definition code for javax.swing.JComponent.addNotify() , addVetoableChangeListener sample code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) , computeVisibleRect sample code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) definition code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) , contains sample code for javax.swing.JComponent.contains(int, int) definition code for javax.swing.JComponent.contains(int, int) , createToolTip sample code for javax.swing.JComponent.createToolTip() definition code for javax.swing.JComponent.createToolTip() , disable sample code for javax.swing.JComponent.disable() definition code for javax.swing.JComponent.disable() , enable sample code for javax.swing.JComponent.enable() definition code for javax.swing.JComponent.enable() , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) , fireVetoableChange sample code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) , getActionForKeyStroke sample code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) , getActionMap sample code for javax.swing.JComponent.getActionMap() definition code for javax.swing.JComponent.getActionMap() , getAlignmentX sample code for javax.swing.JComponent.getAlignmentX() definition code for javax.swing.JComponent.getAlignmentX() , getAlignmentY sample code for javax.swing.JComponent.getAlignmentY() definition code for javax.swing.JComponent.getAlignmentY() , getAncestorListeners sample code for javax.swing.JComponent.getAncestorListeners() definition code for javax.swing.JComponent.getAncestorListeners() , getAutoscrolls sample code for javax.swing.JComponent.getAutoscrolls() definition code for javax.swing.JComponent.getAutoscrolls() , getBorder sample code for javax.swing.JComponent.getBorder() definition code for javax.swing.JComponent.getBorder() , getBounds sample code for javax.swing.JComponent.getBounds(java.awt.Rectangle) definition code for javax.swing.JComponent.getBounds(java.awt.Rectangle) , getClientProperty sample code for javax.swing.JComponent.getClientProperty(java.lang.Object) definition code for javax.swing.JComponent.getClientProperty(java.lang.Object) , getComponentGraphics sample code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) definition code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) , getComponentPopupMenu sample code for javax.swing.JComponent.getComponentPopupMenu() definition code for javax.swing.JComponent.getComponentPopupMenu() , getConditionForKeyStroke sample code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) , getDebugGraphicsOptions sample code for javax.swing.JComponent.getDebugGraphicsOptions() definition code for javax.swing.JComponent.getDebugGraphicsOptions() , getDefaultLocale sample code for javax.swing.JComponent.getDefaultLocale() definition code for javax.swing.JComponent.getDefaultLocale() , getFontMetrics sample code for javax.swing.JComponent.getFontMetrics(java.awt.Font) definition code for javax.swing.JComponent.getFontMetrics(java.awt.Font) , getGraphics sample code for javax.swing.JComponent.getGraphics() definition code for javax.swing.JComponent.getGraphics() , getHeight sample code for javax.swing.JComponent.getHeight() definition code for javax.swing.JComponent.getHeight() , getInheritsPopupMenu sample code for javax.swing.JComponent.getInheritsPopupMenu() definition code for javax.swing.JComponent.getInheritsPopupMenu() , getInputMap sample code for javax.swing.JComponent.getInputMap() definition code for javax.swing.JComponent.getInputMap() , getInputMap sample code for javax.swing.JComponent.getInputMap(int) definition code for javax.swing.JComponent.getInputMap(int) , getInputVerifier sample code for javax.swing.JComponent.getInputVerifier() definition code for javax.swing.JComponent.getInputVerifier() , getInsets sample code for javax.swing.JComponent.getInsets() definition code for javax.swing.JComponent.getInsets() , getInsets sample code for javax.swing.JComponent.getInsets(java.awt.Insets) definition code for javax.swing.JComponent.getInsets(java.awt.Insets) , getListeners sample code for javax.swing.JComponent.getListeners(java.lang.Class) definition code for javax.swing.JComponent.getListeners(java.lang.Class) , getLocation sample code for javax.swing.JComponent.getLocation(java.awt.Point) definition code for javax.swing.JComponent.getLocation(java.awt.Point) , getMaximumSize sample code for javax.swing.JComponent.getMaximumSize() definition code for javax.swing.JComponent.getMaximumSize() , getMinimumSize sample code for javax.swing.JComponent.getMinimumSize() definition code for javax.swing.JComponent.getMinimumSize() , getNextFocusableComponent sample code for javax.swing.JComponent.getNextFocusableComponent() definition code for javax.swing.JComponent.getNextFocusableComponent() , getPopupLocation sample code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) , getRegisteredKeyStrokes sample code for javax.swing.JComponent.getRegisteredKeyStrokes() definition code for javax.swing.JComponent.getRegisteredKeyStrokes() , getRootPane sample code for javax.swing.JComponent.getRootPane() definition code for javax.swing.JComponent.getRootPane() , getSize sample code for javax.swing.JComponent.getSize(java.awt.Dimension) definition code for javax.swing.JComponent.getSize(java.awt.Dimension) , getToolTipLocation sample code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) , getToolTipText sample code for javax.swing.JComponent.getToolTipText() definition code for javax.swing.JComponent.getToolTipText() , getTopLevelAncestor sample code for javax.swing.JComponent.getTopLevelAncestor() definition code for javax.swing.JComponent.getTopLevelAncestor() , getTransferHandler sample code for javax.swing.JComponent.getTransferHandler() definition code for javax.swing.JComponent.getTransferHandler() , getVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() definition code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() , getVetoableChangeListeners sample code for javax.swing.JComponent.getVetoableChangeListeners() definition code for javax.swing.JComponent.getVetoableChangeListeners() , getVisibleRect sample code for javax.swing.JComponent.getVisibleRect() definition code for javax.swing.JComponent.getVisibleRect() , getWidth sample code for javax.swing.JComponent.getWidth() definition code for javax.swing.JComponent.getWidth() , getX sample code for javax.swing.JComponent.getX() definition code for javax.swing.JComponent.getX() , getY sample code for javax.swing.JComponent.getY() definition code for javax.swing.JComponent.getY() , grabFocus sample code for javax.swing.JComponent.grabFocus() definition code for javax.swing.JComponent.grabFocus() , isDoubleBuffered sample code for javax.swing.JComponent.isDoubleBuffered() definition code for javax.swing.JComponent.isDoubleBuffered() , isLightweightComponent sample code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) definition code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) , isManagingFocus sample code for javax.swing.JComponent.isManagingFocus() definition code for javax.swing.JComponent.isManagingFocus() , isOpaque sample code for javax.swing.JComponent.isOpaque() definition code for javax.swing.JComponent.isOpaque() , isOptimizedDrawingEnabled sample code for javax.swing.JComponent.isOptimizedDrawingEnabled() definition code for javax.swing.JComponent.isOptimizedDrawingEnabled() , isPaintingTile sample code for javax.swing.JComponent.isPaintingTile() definition code for javax.swing.JComponent.isPaintingTile() , isRequestFocusEnabled sample code for javax.swing.JComponent.isRequestFocusEnabled() definition code for javax.swing.JComponent.isRequestFocusEnabled() , isValidateRoot sample code for javax.swing.JComponent.isValidateRoot() definition code for javax.swing.JComponent.isValidateRoot() , paint sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) , paintBorder sample code for javax.swing.JComponent.paintBorder(java.awt.Graphics) definition code for javax.swing.JComponent.paintBorder(java.awt.Graphics) , paintChildren sample code for javax.swing.JComponent.paintChildren(java.awt.Graphics) definition code for javax.swing.JComponent.paintChildren(java.awt.Graphics) , paintComponent sample code for javax.swing.JComponent.paintComponent(java.awt.Graphics) definition code for javax.swing.JComponent.paintComponent(java.awt.Graphics) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(int, int, int, int) definition code for javax.swing.JComponent.paintImmediately(int, int, int, int) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) definition code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) , print sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics) , printAll sample code for javax.swing.JComponent.printAll(java.awt.Graphics) definition code for javax.swing.JComponent.printAll(java.awt.Graphics) , printBorder sample code for javax.swing.JComponent.printBorder(java.awt.Graphics) definition code for javax.swing.JComponent.printBorder(java.awt.Graphics) , printChildren sample code for javax.swing.JComponent.printChildren(java.awt.Graphics) definition code for javax.swing.JComponent.printChildren(java.awt.Graphics) , printComponent sample code for javax.swing.JComponent.printComponent(java.awt.Graphics) definition code for javax.swing.JComponent.printComponent(java.awt.Graphics) , processComponentKeyEvent sample code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) , processKeyBinding sample code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) , processKeyEvent sample code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) , processMouseEvent sample code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) , processMouseMotionEvent sample code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) , putClientProperty sample code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) , removeAncestorListener sample code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) , removeVetoableChangeListener sample code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) , repaint sample code for javax.swing.JComponent.repaint(long, int, int, int, int) definition code for javax.swing.JComponent.repaint(long, int, int, int, int) , repaint sample code for javax.swing.JComponent.repaint(java.awt.Rectangle) definition code for javax.swing.JComponent.repaint(java.awt.Rectangle) , requestDefaultFocus sample code for javax.swing.JComponent.requestDefaultFocus() definition code for javax.swing.JComponent.requestDefaultFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus() definition code for javax.swing.JComponent.requestFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus(boolean) definition code for javax.swing.JComponent.requestFocus(boolean) , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow() definition code for javax.swing.JComponent.requestFocusInWindow() , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow(boolean) definition code for javax.swing.JComponent.requestFocusInWindow(boolean) , resetKeyboardActions sample code for javax.swing.JComponent.resetKeyboardActions() definition code for javax.swing.JComponent.resetKeyboardActions() , reshape sample code for javax.swing.JComponent.reshape(int, int, int, int) definition code for javax.swing.JComponent.reshape(int, int, int, int) , revalidate sample code for javax.swing.JComponent.revalidate() definition code for javax.swing.JComponent.revalidate() , scrollRectToVisible sample code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) definition code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) , setActionMap sample code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) definition code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) , setAlignmentX sample code for javax.swing.JComponent.setAlignmentX(float) definition code for javax.swing.JComponent.setAlignmentX(float) , setAlignmentY sample code for javax.swing.JComponent.setAlignmentY(float) definition code for javax.swing.JComponent.setAlignmentY(float) , setAutoscrolls sample code for javax.swing.JComponent.setAutoscrolls(boolean) definition code for javax.swing.JComponent.setAutoscrolls(boolean) , setBackground sample code for javax.swing.JComponent.setBackground(java.awt.Color) definition code for javax.swing.JComponent.setBackground(java.awt.Color) , setBorder sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border) , setComponentPopupMenu sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) , setDebugGraphicsOptions sample code for javax.swing.JComponent.setDebugGraphicsOptions(int) definition code for javax.swing.JComponent.setDebugGraphicsOptions(int) , setDefaultLocale sample code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) definition code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) , setDoubleBuffered sample code for javax.swing.JComponent.setDoubleBuffered(boolean) definition code for javax.swing.JComponent.setDoubleBuffered(boolean) , setEnabled sample code for javax.swing.JComponent.setEnabled(boolean) definition code for javax.swing.JComponent.setEnabled(boolean) , setFocusTraversalKeys sample code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) definition code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) , setFont sample code for javax.swing.JComponent.setFont(java.awt.Font) definition code for javax.swing.JComponent.setFont(java.awt.Font) , setForeground sample code for javax.swing.JComponent.setForeground(java.awt.Color) definition code for javax.swing.JComponent.setForeground(java.awt.Color) , setInheritsPopupMenu sample code for javax.swing.JComponent.setInheritsPopupMenu(boolean) definition code for javax.swing.JComponent.setInheritsPopupMenu(boolean) , setInputMap sample code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) definition code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) , setInputVerifier sample code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) definition code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) , setMaximumSize sample code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) , setMinimumSize sample code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) , setNextFocusableComponent sample code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) definition code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) , setOpaque sample code for javax.swing.JComponent.setOpaque(boolean) definition code for javax.swing.JComponent.setOpaque(boolean) , setPreferredSize sample code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) definition code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) , setRequestFocusEnabled sample code for javax.swing.JComponent.setRequestFocusEnabled(boolean) definition code for javax.swing.JComponent.setRequestFocusEnabled(boolean) , setToolTipText sample code for javax.swing.JComponent.setToolTipText(java.lang.String) definition code for javax.swing.JComponent.setToolTipText(java.lang.String) , setTransferHandler sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) , setUI sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) , setVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) definition code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) , setVisible sample code for javax.swing.JComponent.setVisible(boolean) definition code for javax.swing.JComponent.setVisible(boolean) , unregisterKeyboardAction sample code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) definition code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) , update sample code for javax.swing.JComponent.update(java.awt.Graphics) definition code for javax.swing.JComponent.update(java.awt.Graphics)
 
Methods inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
add sample code for java.awt.Container.add(java.awt.Component) definition code for java.awt.Container.add(java.awt.Component) , add sample code for java.awt.Container.add(java.awt.Component, int) definition code for java.awt.Container.add(java.awt.Component, int) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) , add sample code for java.awt.Container.add(java.lang.String, java.awt.Component) definition code for java.awt.Container.add(java.lang.String, java.awt.Component) , addContainerListener sample code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) , addImpl sample code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , applyComponentOrientation sample code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) , areFocusTraversalKeysSet sample code for java.awt.Container.areFocusTraversalKeysSet(int) definition code for java.awt.Container.areFocusTraversalKeysSet(int) , countComponents sample code for java.awt.Container.countComponents() definition code for java.awt.Container.countComponents() , deliverEvent sample code for java.awt.Container.deliverEvent(java.awt.Event) definition code for java.awt.Container.deliverEvent(java.awt.Event) , doLayout sample code for java.awt.Container.doLayout() definition code for java.awt.Container.doLayout() , findComponentAt sample code for java.awt.Container.findComponentAt(int, int) definition code for java.awt.Container.findComponentAt(int, int) , findComponentAt sample code for java.awt.Container.findComponentAt(java.awt.Point) definition code for java.awt.Container.findComponentAt(java.awt.Point) , getComponent sample code for java.awt.Container.getComponent(int) definition code for java.awt.Container.getComponent(int) , getComponentAt sample code for java.awt.Container.getComponentAt(int, int) definition code for java.awt.Container.getComponentAt(int, int) , getComponentAt sample code for java.awt.Container.getComponentAt(java.awt.Point) definition code for java.awt.Container.getComponentAt(java.awt.Point) , getComponentCount sample code for java.awt.Container.getComponentCount() definition code for java.awt.Container.getComponentCount() , getComponents sample code for java.awt.Container.getComponents() definition code for java.awt.Container.getComponents() , getComponentZOrder sample code for java.awt.Container.getComponentZOrder(java.awt.Component) definition code for java.awt.Container.getComponentZOrder(java.awt.Component) , getContainerListeners sample code for java.awt.Container.getContainerListeners() definition code for java.awt.Container.getContainerListeners() , getFocusTraversalKeys sample code for java.awt.Container.getFocusTraversalKeys(int) definition code for java.awt.Container.getFocusTraversalKeys(int) , getFocusTraversalPolicy sample code for java.awt.Container.getFocusTraversalPolicy() definition code for java.awt.Container.getFocusTraversalPolicy() , getLayout sample code for java.awt.Container.getLayout() definition code for java.awt.Container.getLayout() , getMousePosition sample code for java.awt.Container.getMousePosition(boolean) definition code for java.awt.Container.getMousePosition(boolean) , insets sample code for java.awt.Container.insets() definition code for java.awt.Container.insets() , invalidate sample code for java.awt.Container.invalidate() definition code for java.awt.Container.invalidate() , isAncestorOf sample code for java.awt.Container.isAncestorOf(java.awt.Component) definition code for java.awt.Container.isAncestorOf(java.awt.Component) , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot() definition code for java.awt.Container.isFocusCycleRoot() , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot(java.awt.Container) definition code for java.awt.Container.isFocusCycleRoot(java.awt.Container) , isFocusTraversalPolicyProvider sample code for java.awt.Container.isFocusTraversalPolicyProvider() definition code for java.awt.Container.isFocusTraversalPolicyProvider() , isFocusTraversalPolicySet sample code for java.awt.Container.isFocusTraversalPolicySet() definition code for java.awt.Container.isFocusTraversalPolicySet() , layout sample code for java.awt.Container.layout() definition code for java.awt.Container.layout() , list sample code for java.awt.Container.list(java.io.PrintStream, int) definition code for java.awt.Container.list(java.io.PrintStream, int) , list sample code for java.awt.Container.list(java.io.PrintWriter, int) definition code for java.awt.Container.list(java.io.PrintWriter, int) , locate sample code for java.awt.Container.locate(int, int) definition code for java.awt.Container.locate(int, int) , minimumSize sample code for java.awt.Container.minimumSize() definition code for java.awt.Container.minimumSize() , paintComponents sample code for java.awt.Container.paintComponents(java.awt.Graphics) definition code for java.awt.Container.paintComponents(java.awt.Graphics) , preferredSize sample code for java.awt.Container.preferredSize() definition code for java.awt.Container.preferredSize() , printComponents sample code for java.awt.Container.printComponents(java.awt.Graphics) definition code for java.awt.Container.printComponents(java.awt.Graphics) , processContainerEvent sample code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) definition code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) , processEvent sample code for java.awt.Container.processEvent(java.awt.AWTEvent) definition code for java.awt.Container.processEvent(java.awt.AWTEvent) , remove sample code for java.awt.Container.remove(java.awt.Component) definition code for java.awt.Container.remove(java.awt.Component) , remove sample code for java.awt.Container.remove(int) definition code for java.awt.Container.remove(int) , removeAll sample code for java.awt.Container.removeAll() definition code for java.awt.Container.removeAll() , removeContainerListener sample code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) , setComponentZOrder sample code for java.awt.Container.setComponentZOrder(java.awt.Component, int) definition code for java.awt.Container.setComponentZOrder(java.awt.Component, int) , setFocusCycleRoot sample code for java.awt.Container.setFocusCycleRoot(boolean) definition code for java.awt.Container.setFocusCycleRoot(boolean) , setFocusTraversalPolicy sample code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) definition code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) , setFocusTraversalPolicyProvider sample code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) definition code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) , setLayout sample code for java.awt.Container.setLayout(java.awt.LayoutManager) definition code for java.awt.Container.setLayout(java.awt.LayoutManager) , transferFocusBackward sample code for java.awt.Container.transferFocusBackward() definition code for java.awt.Container.transferFocusBackward() , transferFocusDownCycle sample code for java.awt.Container.transferFocusDownCycle() definition code for java.awt.Container.transferFocusDownCycle() , validate sample code for java.awt.Container.validate() definition code for java.awt.Container.validate() , validateTree sample code for java.awt.Container.validateTree() definition code for java.awt.Container.validateTree()
 
Methods inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
action sample code for java.awt.Component.action(java.awt.Event, java.lang.Object) definition code for java.awt.Component.action(java.awt.Event, java.lang.Object) , add sample code for java.awt.Component.add(java.awt.PopupMenu) definition code for java.awt.Component.add(java.awt.PopupMenu) , addComponentListener sample code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) , addFocusListener sample code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) , addHierarchyBoundsListener sample code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , addHierarchyListener sample code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) , addKeyListener sample code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) , addMouseListener sample code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) , addMouseMotionListener sample code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) , addMouseWheelListener sample code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) , bounds sample code for java.awt.Component.bounds() definition code for java.awt.Component.bounds() , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , coalesceEvents sample code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) definition code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) , contains sample code for java.awt.Component.contains(java.awt.Point) definition code for java.awt.Component.contains(java.awt.Point) , createImage sample code for java.awt.Component.createImage(java.awt.image.ImageProducer) definition code for java.awt.Component.createImage(java.awt.image.ImageProducer) , createImage sample code for java.awt.Component.createImage(int, int) definition code for java.awt.Component.createImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int) definition code for java.awt.Component.createVolatileImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) definition code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) , disableEvents sample code for java.awt.Component.disableEvents(long) definition code for java.awt.Component.disableEvents(long) , dispatchEvent sample code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) definition code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) , enable sample code for java.awt.Component.enable(boolean) definition code for java.awt.Component.enable(boolean) , enableEvents sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long) , enableInputMethods sample code for java.awt.Component.enableInputMethods(boolean) definition code for java.awt.Component.enableInputMethods(boolean) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) definition code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, double, double) definition code for java.awt.Component.firePropertyChange(java.lang.String, double, double) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, float, float) definition code for java.awt.Component.firePropertyChange(java.lang.String, float, float) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, long, long) definition code for java.awt.Component.firePropertyChange(java.lang.String, long, long) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, short, short) definition code for java.awt.Component.firePropertyChange(java.lang.String, short, short) , getBackground sample code for java.awt.Component.getBackground() definition code for java.awt.Component.getBackground() , getBounds sample code for java.awt.Component.getBounds() definition code for java.awt.Component.getBounds() , getColorModel sample code for java.awt.Component.getColorModel() definition code for java.awt.Component.getColorModel() , getComponentListeners sample code for java.awt.Component.getComponentListeners() definition code for java.awt.Component.getComponentListeners() , getComponentOrientation sample code for java.awt.Component.getComponentOrientation() definition code for java.awt.Component.getComponentOrientation() , getCursor sample code for java.awt.Component.getCursor() definition code for java.awt.Component.getCursor() , getDropTarget sample code for java.awt.Component.getDropTarget() definition code for java.awt.Component.getDropTarget() , getFocusCycleRootAncestor sample code for java.awt.Component.getFocusCycleRootAncestor() definition code for java.awt.Component.getFocusCycleRootAncestor() , getFocusListeners sample code for java.awt.Component.getFocusListeners() definition code for java.awt.Component.getFocusListeners() , getFocusTraversalKeysEnabled sample code for java.awt.Component.getFocusTraversalKeysEnabled() definition code for java.awt.Component.getFocusTraversalKeysEnabled() , getFont sample code for java.awt.Component.getFont() definition code for java.awt.Component.getFont() , getForeground sample code for java.awt.Component.getForeground() definition code for java.awt.Component.getForeground() , getGraphicsConfiguration sample code for java.awt.Component.getGraphicsConfiguration() definition code for java.awt.Component.getGraphicsConfiguration() , getHierarchyBoundsListeners sample code for java.awt.Component.getHierarchyBoundsListeners() definition code for java.awt.Component.getHierarchyBoundsListeners() , getHierarchyListeners sample code for java.awt.Component.getHierarchyListeners() definition code for java.awt.Component.getHierarchyListeners() , getIgnoreRepaint sample code for java.awt.Component.getIgnoreRepaint() definition code for java.awt.Component.getIgnoreRepaint() , getInputContext sample code for java.awt.Component.getInputContext() definition code for java.awt.Component.getInputContext() , getInputMethodListeners sample code for java.awt.Component.getInputMethodListeners() definition code for java.awt.Component.getInputMethodListeners() , getKeyListeners sample code for java.awt.Component.getKeyListeners() definition code for java.awt.Component.getKeyListeners() , getLocale sample code for java.awt.Component.getLocale() definition code for java.awt.Component.getLocale() , getLocation sample code for java.awt.Component.getLocation() definition code for java.awt.Component.getLocation() , getLocationOnScreen sample code for java.awt.Component.getLocationOnScreen() definition code for java.awt.Component.getLocationOnScreen() , getMouseListeners sample code for java.awt.Component.getMouseListeners() definition code for java.awt.Component.getMouseListeners() , getMouseMotionListeners sample code for java.awt.Component.getMouseMotionListeners() definition code for java.awt.Component.getMouseMotionListeners() , getMousePosition sample code for java.awt.Component.getMousePosition() definition code for java.awt.Component.getMousePosition() , getMouseWheelListeners sample code for java.awt.Component.getMouseWheelListeners() definition code for java.awt.Component.getMouseWheelListeners() , getName sample code for java.awt.Component.getName() definition code for java.awt.Component.getName() , getParent sample code for java.awt.Component.getParent() definition code for java.awt.Component.getParent() , getPeer sample code for java.awt.Component.getPeer() definition code for java.awt.Component.getPeer() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners() definition code for java.awt.Component.getPropertyChangeListeners() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners(java.lang.String) definition code for java.awt.Component.getPropertyChangeListeners(java.lang.String) , getSize sample code for java.awt.Component.getSize() definition code for java.awt.Component.getSize() , getToolkit sample code for java.awt.Component.getToolkit() definition code for java.awt.Component.getToolkit() , getTreeLock sample code for java.awt.Component.getTreeLock() definition code for java.awt.Component.getTreeLock() , gotFocus sample code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) , handleEvent sample code for java.awt.Component.handleEvent(java.awt.Event) definition code for java.awt.Component.handleEvent(java.awt.Event) , hasFocus sample code for java.awt.Component.hasFocus() definition code for java.awt.Component.hasFocus() , hide sample code for java.awt.Component.hide() definition code for java.awt.Component.hide() , imageUpdate sample code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) definition code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) , inside sample code for java.awt.Component.inside(int, int) definition code for java.awt.Component.inside(int, int) , isBackgroundSet sample code for java.awt.Component.isBackgroundSet() definition code for java.awt.Component.isBackgroundSet() , isCursorSet sample code for java.awt.Component.isCursorSet() definition code for java.awt.Component.isCursorSet() , isDisplayable sample code for java.awt.Component.isDisplayable() definition code for java.awt.Component.isDisplayable() , isEnabled sample code for java.awt.Component.isEnabled() definition code for java.awt.Component.isEnabled() , isFocusable sample code for java.awt.Component.isFocusable() definition code for java.awt.Component.isFocusable() , isFocusOwner sample code for java.awt.Component.isFocusOwner() definition code for java.awt.Component.isFocusOwner() , isFocusTraversable sample code for java.awt.Component.isFocusTraversable() definition code for java.awt.Component.isFocusTraversable() , isFontSet sample code for java.awt.Component.isFontSet() definition code for java.awt.Component.isFontSet() , isForegroundSet sample code for java.awt.Component.isForegroundSet() definition code for java.awt.Component.isForegroundSet() , isLightweight sample code for java.awt.Component.isLightweight() definition code for java.awt.Component.isLightweight() , isMaximumSizeSet sample code for java.awt.Component.isMaximumSizeSet() definition code for java.awt.Component.isMaximumSizeSet() , isMinimumSizeSet sample code for java.awt.Component.isMinimumSizeSet() definition code for java.awt.Component.isMinimumSizeSet() , isPreferredSizeSet sample code for java.awt.Component.isPreferredSizeSet() definition code for java.awt.Component.isPreferredSizeSet() , isShowing sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing() , isValid sample code for java.awt.Component.isValid() definition code for java.awt.Component.isValid() , isVisible sample code for java.awt.Component.isVisible() definition code for java.awt.Component.isVisible() , keyDown sample code for java.awt.Component.keyDown(java.awt.Event, int) definition code for java.awt.Component.keyDown(java.awt.Event, int) , keyUp sample code for java.awt.Component.keyUp(java.awt.Event, int) definition code for java.awt.Component.keyUp(java.awt.Event, int) , list sample code for java.awt.Component.list() definition code for java.awt.Component.list() , list sample code for java.awt.Component.list(java.io.PrintStream) definition code for java.awt.Component.list(java.io.PrintStream) , list sample code for java.awt.Component.list(java.io.PrintWriter) definition code for java.awt.Component.list(java.io.PrintWriter) , location sample code for java.awt.Component.location() definition code for java.awt.Component.location() , lostFocus sample code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) , mouseDown sample code for java.awt.Component.mouseDown(java.awt.Event, int, int) definition code for java.awt.Component.mouseDown(java.awt.Event, int, int) , mouseDrag sample code for java.awt.Component.mouseDrag(java.awt.Event, int, int) definition code for java.awt.Component.mouseDrag(java.awt.Event, int, int) , mouseEnter sample code for java.awt.Component.mouseEnter(java.awt.Event, int, int) definition code for java.awt.Component.mouseEnter(java.awt.Event, int, int) , mouseExit sample code for java.awt.Component.mouseExit(java.awt.Event, int, int) definition code for java.awt.Component.mouseExit(java.awt.Event, int, int) , mouseMove sample code for java.awt.Component.mouseMove(java.awt.Event, int, int) definition code for java.awt.Component.mouseMove(java.awt.Event, int, int) , mouseUp sample code for java.awt.Component.mouseUp(java.awt.Event, int, int) definition code for java.awt.Component.mouseUp(java.awt.Event, int, int) , move sample code for java.awt.Component.move(int, int) definition code for java.awt.Component.move(int, int) , nextFocus sample code for java.awt.Component.nextFocus() definition code for java.awt.Component.nextFocus() , paintAll sample code for java.awt.Component.paintAll(java.awt.Graphics) definition code for java.awt.Component.paintAll(java.awt.Graphics) , postEvent sample code for java.awt.Component.postEvent(java.awt.Event) definition code for java.awt.Component.postEvent(java.awt.Event) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , processComponentEvent sample code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) definition code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) , processFocusEvent sample code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) definition code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) , processHierarchyBoundsEvent sample code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) , processHierarchyEvent sample code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) , processMouseWheelEvent sample code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) definition code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) , remove sample code for java.awt.Component.remove(java.awt.MenuComponent) definition code for java.awt.Component.remove(java.awt.MenuComponent) , removeComponentListener sample code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) , removeFocusListener sample code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) , removeHierarchyBoundsListener sample code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , removeHierarchyListener sample code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) , removeInputMethodListener sample code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) , removeKeyListener sample code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) , removeMouseListener sample code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) , removeMouseMotionListener sample code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) , removeMouseWheelListener sample code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , repaint sample code for java.awt.Component.repaint() definition code for java.awt.Component.repaint() , repaint sample code for java.awt.Component.repaint(int, int, int, int) definition code for java.awt.Component.repaint(int, int, int, int) , repaint sample code for java.awt.Component.repaint(long) definition code for java.awt.Component.repaint(long) , resize sample code for java.awt.Component.resize(java.awt.Dimension) definition code for java.awt.Component.resize(java.awt.Dimension) , resize sample code for java.awt.Component.resize(int, int) definition code for java.awt.Component.resize(int, int) , setBounds sample code for java.awt.Component.setBounds(int, int, int, int) definition code for java.awt.Component.setBounds(int, int, int, int) , setBounds sample code for java.awt.Component.setBounds(java.awt.Rectangle) definition code for java.awt.Component.setBounds(java.awt.Rectangle) , setCursor sample code for java.awt.Component.setCursor(java.awt.Cursor) definition code for java.awt.Component.setCursor(java.awt.Cursor) , setDropTarget sample code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) definition code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) , setFocusable sample code for java.awt.Component.setFocusable(boolean) definition code for java.awt.Component.setFocusable(boolean) , setFocusTraversalKeysEnabled sample code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) definition code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) , setIgnoreRepaint sample code for java.awt.Component.setIgnoreRepaint(boolean) definition code for java.awt.Component.setIgnoreRepaint(boolean) , setLocale sample code for java.awt.Component.setLocale(java.util.Locale) definition code for java.awt.Component.setLocale(java.util.Locale) , setLocation sample code for java.awt.Component.setLocation(int, int) definition code for java.awt.Component.setLocation(int, int) , setLocation sample code for java.awt.Component.setLocation(java.awt.Point) definition code for java.awt.Component.setLocation(java.awt.Point) , setName sample code for java.awt.Component.setName(java.lang.String) definition code for java.awt.Component.setName(java.lang.String) , setSize sample code for java.awt.Component.setSize(java.awt.Dimension) definition code for java.awt.Component.setSize(java.awt.Dimension) , setSize sample code for java.awt.Component.setSize(int, int) definition code for java.awt.Component.setSize(int, int) , show sample code for java.awt.Component.show() definition code for java.awt.Component.show() , show sample code for java.awt.Component.show(boolean) definition code for java.awt.Component.show(boolean) , size sample code for java.awt.Component.size() definition code for java.awt.Component.size() , toString sample code for java.awt.Component.toString() definition code for java.awt.Component.toString() , transferFocus sample code for java.awt.Component.transferFocus() definition code for java.awt.Component.transferFocus() , transferFocusUpCycle sample code for java.awt.Component.transferFocusUpCycle() definition code for java.awt.Component.transferFocusUpCycle()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

W3C_LENGTH_UNITS sample code for javax.swing.JEditorPane.W3C_LENGTH_UNITS

public static final String sample code for java.lang.String definition code for java.lang.String  W3C_LENGTH_UNITS
Key for a client property used to indicate whether w3c compliant length units are used for html rendering.

By default this is not enabled; to enable it set the client property with this name to Boolean.TRUE.

Since:
1.5
See Also:
Constant Field Values

HONOR_DISPLAY_PROPERTIES sample code for javax.swing.JEditorPane.HONOR_DISPLAY_PROPERTIES

public static final String sample code for java.lang.String definition code for java.lang.String  HONOR_DISPLAY_PROPERTIES
Key for a client property used to indicate whether the default font and foreground color from the component are used if a font or foreground color is not specified in the styled text.

The default varies based on the look and feel; to enable it set the client property with this name to Boolean.TRUE.

Since:
1.5
See Also:
Constant Field Values
Constructor Detail

JEditorPane sample code for javax.swing.JEditorPane() definition code for javax.swing.JEditorPane()

public JEditorPane()
Creates a new JEditorPane. The document model is set to null.


JEditorPane sample code for javax.swing.JEditorPane(java.net.URL) definition code for javax.swing.JEditorPane(java.net.URL)

public JEditorPane(URL sample code for java.net.URL definition code for java.net.URL  initialPage)
            throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Creates a JEditorPane based on a specified URL for input.

Parameters:
initialPage - the URL
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if the URL is null or cannot be accessed

JEditorPane sample code for javax.swing.JEditorPane(java.lang.String) definition code for javax.swing.JEditorPane(java.lang.String)

public JEditorPane(String sample code for java.lang.String definition code for java.lang.String  url)
            throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Creates a JEditorPane based on a string containing a URL specification.

Parameters:
url - the URL
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if the URL is null or cannot be accessed

JEditorPane sample code for javax.swing.JEditorPane(java.lang.String, java.lang.String) definition code for javax.swing.JEditorPane(java.lang.String, java.lang.String)

public JEditorPane(String sample code for java.lang.String definition code for java.lang.String  type,
                   String sample code for java.lang.String definition code for java.lang.String  text)
Creates a JEditorPane that has been initialized to the given text. This is a convenience constructor that calls the setContentType and setText methods.

Parameters:
type - mime type of the given text
text - the text to initialize with; may be null
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if the type parameter is null
Method Detail

addHyperlinkListener sample code for javax.swing.JEditorPane.addHyperlinkListener(javax.swing.event.HyperlinkListener) definition code for javax.swing.JEditorPane.addHyperlinkListener(javax.swing.event.HyperlinkListener)

public void addHyperlinkListener(HyperlinkListener sample code for javax.swing.event.HyperlinkListener definition code for javax.swing.event.HyperlinkListener  listener)
Adds a hyperlink listener for notification of any changes, for example when a link is selected and entered.

Parameters:
listener - the listener

removeHyperlinkListener sample code for javax.swing.JEditorPane.removeHyperlinkListener(javax.swing.event.HyperlinkListener) definition code for javax.swing.JEditorPane.removeHyperlinkListener(javax.swing.event.HyperlinkListener)

public void removeHyperlinkListener(HyperlinkListener sample code for javax.swing.event.HyperlinkListener definition code for javax.swing.event.HyperlinkListener  listener)
Removes a hyperlink listener.

Parameters:
listener - the listener

getHyperlinkListeners sample code for javax.swing.JEditorPane.getHyperlinkListeners() definition code for javax.swing.JEditorPane.getHyperlinkListeners()

public HyperlinkListener sample code for javax.swing.event.HyperlinkListener definition code for javax.swing.event.HyperlinkListener [] getHyperlinkListeners()
Returns an array of all the HyperLinkListeners added to this JEditorPane with addHyperlinkListener().

Returns:
all of the HyperLinkListeners added or an empty array if no listeners have been added
Since:
1.4

fireHyperlinkUpdate sample code for javax.swing.JEditorPane.fireHyperlinkUpdate(javax.swing.event.HyperlinkEvent) definition code for javax.swing.JEditorPane.fireHyperlinkUpdate(javax.swing.event.HyperlinkEvent)

public void fireHyperlinkUpdate(HyperlinkEvent sample code for javax.swing.event.HyperlinkEvent definition code for javax.swing.event.HyperlinkEvent  e)
Notifies all listeners that have registered interest for notification on this event type. This is normally called by the currently installed EditorKit if a content type that supports hyperlinks is currently active and there was activity with a link. The listener list is processed last to first.

Parameters:
e - the event
See Also:
EventListenerList sample code for javax.swing.event.EventListenerList definition code for javax.swing.event.EventListenerList

setPage sample code for javax.swing.JEditorPane.setPage(java.net.URL) definition code for javax.swing.JEditorPane.setPage(java.net.URL)

public void setPage(URL sample code for java.net.URL definition code for java.net.URL  page)
             throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Sets the current URL being displayed. The content type of the pane is set, and if the editor kit for the pane is non-null, then a new default document is created and the URL is read into it. If the URL contains and reference location, the location will be scrolled to by calling the scrollToReference method. If the desired URL is the one currently being displayed, the document will not be reloaded. To force a document reload it is necessary to clear the stream description property of the document. The following code shows how this can be done:
   Document doc = jEditorPane.getDocument();
   doc.putProperty(Document.StreamDescriptionProperty, null);
 
If the desired URL is not the one currently being displayed, the getStream method is called to give subclasses control over the stream provided.

This may load either synchronously or asynchronously depending upon the document returned by the EditorKit. If the Document is of type AbstractDocument and has a value returned by AbstractDocument.getAsynchronousLoadPriority that is greater than or equal to zero, the page will be loaded on a separate thread using that priority.

If the document is loaded synchronously, it will be filled in with the stream prior to being installed into the editor with a call to setDocument, which is bound and will fire a property change event. If an IOException is thrown the partially loaded document will be discarded and neither the document or page property change events will be fired. If the document is successfully loaded and installed, a view will be built for it by the UI which will then be scrolled if necessary, and then the page property change event will be fired.

If the document is loaded asynchronously, the document will be installed into the editor immediately using a call to setDocument which will fire a document property change event, then a thread will be created which will begin doing the actual loading. In this case, the page property change event will not be fired by the call to this method directly, but rather will be fired when the thread doing the loading has finished. It will also be fired on the event-dispatch thread. Since the calling thread can not throw an IOException in the event of failure on the other thread, the page property change event will be fired when the other thread is done whether the load was successful or not.

Parameters:
page - the URL of the page
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - for a null or invalid page specification, or exception from the stream being read
See Also:
getPage() sample code for javax.swing.JEditorPane.getPage() definition code for javax.swing.JEditorPane.getPage()

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)

public void read(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  in,
                 Object sample code for java.lang.Object definition code for java.lang.Object  desc)
          throws IOException sample code for java.io.IOException definition code for java.io.IOException 
This method initializes from a stream. If the kit is set to be of type HTMLEditorKit, and the desc parameter is an HTMLDocument, then it invokes the HTMLEditorKit to initiate the read. Otherwise it calls the superclass method which loads the model as plain text.

Parameters:
in - the stream from which to read
desc - an object describing the stream
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - as thrown by the stream being used to initialize
See Also:
JTextComponent.read(java.io.Reader, java.lang.Object) sample code for javax.swing.text.JTextComponent.read(java.io.Reader, java.lang.Object) definition code for javax.swing.text.JTextComponent.read(java.io.Reader, java.lang.Object) , JTextComponent.setDocument(javax.swing.text.Document) sample code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document) definition code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document)

getStream sample code for javax.swing.JEditorPane.getStream(java.net.URL) definition code for javax.swing.JEditorPane.getStream(java.net.URL)

protected InputStream sample code for java.io.InputStream definition code for java.io.InputStream  getStream(URL sample code for java.net.URL definition code for java.net.URL  page)
                         throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Fetches a stream for the given URL, which is about to be loaded by the setPage method. By default, this simply opens the URL and returns the stream. This can be reimplemented to do useful things like fetch the stream from a cache, monitor the progress of the stream, etc.

This method is expected to have the the side effect of establishing the content type, and therefore setting the appropriate EditorKit to use for loading the stream.

If this the stream was an http connection, redirects will be followed and the resulting URL will be set as the Document.StreamDescriptionProperty so that relative URL's can be properly resolved.

Parameters:
page - the URL of the page
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException

scrollToReference sample code for javax.swing.JEditorPane.scrollToReference(java.lang.String) definition code for javax.swing.JEditorPane.scrollToReference(java.lang.String)

public void scrollToReference(String sample code for java.lang.String definition code for java.lang.String  reference)
Scrolls the view to the given reference location (that is, the value returned by the UL.getRef method for the URL being displayed). By default, this method only knows how to locate a reference in an HTMLDocument. The implementation calls the scrollRectToVisible method to accomplish the actual scrolling. If scrolling to a reference location is needed for document types other than HTML, this method should be reimplemented. This method will have no effect if the component is not visible.

Parameters:
reference - the named location to scroll to

getPage sample code for javax.swing.JEditorPane.getPage() definition code for javax.swing.JEditorPane.getPage()

public URL sample code for java.net.URL definition code for java.net.URL  getPage()
Gets the current URL being displayed. If a URL was not specified in the creation of the document, this will return null, and relative URL's will not be resolved.

Returns:
the URL, or null if none

setPage sample code for javax.swing.JEditorPane.setPage(java.lang.String) definition code for javax.swing.JEditorPane.setPage(java.lang.String)

public void setPage(String sample code for java.lang.String definition code for java.lang.String  url)
             throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Sets the current URL being displayed.

Parameters:
url - the URL for display
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - for a null or invalid URL specification

getUIClassID sample code for javax.swing.JEditorPane.getUIClassID() definition code for javax.swing.JEditorPane.getUIClassID()

public String sample code for java.lang.String definition code for java.lang.String  getUIClassID()
Gets the class ID for the UI.

Overrides:
getUIClassID sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
the string "EditorPaneUI"
See Also:
JComponent.getUIClassID() sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() , UIDefaults.getUI(javax.swing.JComponent) sample code for javax.swing.UIDefaults.getUI(javax.swing.JComponent) definition code for javax.swing.UIDefaults.getUI(javax.swing.JComponent)

createDefaultEditorKit sample code for javax.swing.JEditorPane.createDefaultEditorKit() definition code for javax.swing.JEditorPane.createDefaultEditorKit()

protected EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit  createDefaultEditorKit()
Creates the default editor kit (PlainEditorKit) for when the component is first created.

Returns:
the editor kit

getEditorKit sample code for javax.swing.JEditorPane.getEditorKit() definition code for javax.swing.JEditorPane.getEditorKit()

public EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit  getEditorKit()
Fetches the currently installed kit for handling content. createDefaultEditorKit is called to set up a default if necessary.

Returns:
the editor kit

getContentType sample code for javax.swing.JEditorPane.getContentType() definition code for javax.swing.JEditorPane.getContentType()

public final String sample code for java.lang.String definition code for java.lang.String  getContentType()
Gets the type of content that this editor is currently set to deal with. This is defined to be the type associated with the currently installed EditorKit.

Returns:
the content type, null if no editor kit set

setContentType sample code for javax.swing.JEditorPane.setContentType(java.lang.String) definition code for javax.swing.JEditorPane.setContentType(java.lang.String)

public final void setContentType(String sample code for java.lang.String definition code for java.lang.String  type)
Sets the type of content that this editor handles. This calls getEditorKitForContentType, and then setEditorKit if an editor kit can be successfully located. This is mostly convenience method that can be used as an alternative to calling setEditorKit directly.

If there is a charset definition specified as a parameter of the content type specification, it will be used when loading input streams using the associated EditorKit. For example if the type is specified as text/html; charset=EUC-JP the content will be loaded using the EditorKit registered for text/html and the Reader provided to the EditorKit to load unicode into the document will use the EUC-JP charset for translating to unicode. If the type is not recognized, the content will be loaded using the EditorKit registered for plain text, text/plain.

Parameters:
type - the non-null mime type for the content editing support
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if the type parameter is null
See Also:
getContentType() sample code for javax.swing.JEditorPane.getContentType() definition code for javax.swing.JEditorPane.getContentType()

setEditorKit sample code for javax.swing.JEditorPane.setEditorKit(javax.swing.text.EditorKit) definition code for javax.swing.JEditorPane.setEditorKit(javax.swing.text.EditorKit)

public void setEditorKit(EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit  kit)
Sets the currently installed kit for handling content. This is the bound property that establishes the content type of the editor. Any old kit is first deinstalled, then if kit is non-null, the new kit is installed, and a default document created for it. A PropertyChange event ("editorKit") is always fired when setEditorKit is called.

NOTE: This has the side effect of changing the model, because the EditorKit is the source of how a particular type of content is modeled. This method will cause setDocument to be called on behalf of the caller to ensure integrity of the internal state.

Parameters:
kit - the desired editor behavior
See Also:
getEditorKit() sample code for javax.swing.JEditorPane.getEditorKit() definition code for javax.swing.JEditorPane.getEditorKit()

getEditorKitForContentType sample code for javax.swing.JEditorPane.getEditorKitForContentType(java.lang.String) definition code for javax.swing.JEditorPane.getEditorKitForContentType(java.lang.String)

public EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit  getEditorKitForContentType(String sample code for java.lang.String definition code for java.lang.String  type)
Fetches the editor kit to use for the given type of content. This is called when a type is requested that doesn't match the currently installed type. If the component doesn't have an EditorKit registered for the given type, it will try to create an EditorKit from the default EditorKit registry. If that fails, a PlainEditorKit is used on the assumption that all text documents can be represented as plain text.

This method can be reimplemented to use some other kind of type registry. This can be reimplemented to use the Java Activation Framework, for example.

Parameters:
type - the non-null content type
Returns:
the editor kit

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)

public void setEditorKitForContentType(String sample code for java.lang.String definition code for java.lang.String  type,
                                       EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit  k)
Directly sets the editor kit to use for the given type. A look-and-feel implementation might use this in conjunction with createEditorKitForContentType to install handlers for content types with a look-and-feel bias.

Parameters:
type - the non-null content type
k - the editor kit to be set

replaceSelection sample code for javax.swing.JEditorPane.replaceSelection(java.lang.String) definition code for javax.swing.JEditorPane.replaceSelection(java.lang.String)

public void replaceSelection(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. If there is no selection this amounts to an insert of the given text. If there is no replacement text (i.e. the content string is empty or null) this amounts to a removal of the current selection. The replacement text will have the attributes currently defined for input. If the component is not editable, beep and return.

This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.

Overrides:
replaceSelection sample code for javax.swing.text.JTextComponent.replaceSelection(java.lang.String) definition code for javax.swing.text.JTextComponent.replaceSelection(java.lang.String) in class JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
Parameters:
content - the content to replace the selection with. This value can be null

createEditorKitForContentType sample code for javax.swing.JEditorPane.createEditorKitForContentType(java.lang.String) definition code for javax.swing.JEditorPane.createEditorKitForContentType(java.lang.String)

public static EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit  createEditorKitForContentType(String sample code for java.lang.String definition code for java.lang.String  type)
Creates a handler for the given type from the default registry of editor kits. The registry is created if necessary. If the registered class has not yet been loaded, an attempt is made to dynamically load the prototype of the kit for the given type. If the type was registered with a ClassLoader, that ClassLoader will be used to load the prototype. If there was no registered ClassLoader, Class.forName will be used to load the prototype.

Once a prototype EditorKit instance is successfully located, it is cloned and the clone is returned.

Parameters:
type - the content type
Returns:
the editor kit, or null if there is nothing registered for the given type

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)

public static void registerEditorKitForContentType(String sample code for java.lang.String definition code for java.lang.String  type,
                                                   String sample code for java.lang.String definition code for java.lang.String  classname)
Establishes the default bindings of type to classname. The class will be dynamically loaded later when actually needed, and can be safely changed before attempted uses to avoid loading unwanted classes. The prototype EditorKit will be loaded with Class.forName when registered with this method.

Parameters:
type - the non-null content type
classname - the class to load later

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)

public static void registerEditorKitForContentType(String sample code for java.lang.String definition code for java.lang.String  type,
                                                   String sample code for java.lang.String definition code for java.lang.String  classname,
                                                   ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  loader)
Establishes the default bindings of type to classname. The class will be dynamically loaded later when actually needed using the given ClassLoader, and can be safely changed before attempted uses to avoid loading unwanted classes.

Parameters:
type - the non-null content type
classname - the class to load later
loader - the ClassLoader to use to load the name

getEditorKitClassNameForContentType sample code for javax.swing.JEditorPane.getEditorKitClassNameForContentType(java.lang.String) definition code for javax.swing.JEditorPane.getEditorKitClassNameForContentType(java.lang.String)

public static String sample code for java.lang.String definition code for java.lang.String  getEditorKitClassNameForContentType(String sample code for java.lang.String definition code for java.lang.String  type)
Returns the currently registered EditorKit class name for the type type.

Parameters:
type - the non-null content type
Since:
1.3

getPreferredSize sample code for javax.swing.JEditorPane.getPreferredSize() definition code for javax.swing.JEditorPane.getPreferredSize()

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getPreferredSize()
Returns the preferred size for the JEditorPane. The preferred size for JEditorPane is slightly altered from the preferred size of the superclass. If the size of the viewport has become smaller than the minimum size of the component, the scrollable definition for tracking width or height will turn to false. The default viewport layout will give the preferred size, and that is not desired in the case where the scrollable is tracking. In that case the normal preferred size is adjusted to the minimum size. This allows things like HTML tables to shrink down to their minimum size and then be laid out at their minimum size, refusing to shrink any further.

Overrides:
getPreferredSize sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
a Dimension containing the preferred size
See Also:
JComponent.setPreferredSize(java.awt.Dimension) sample code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) definition code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) , ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI

setText sample code for javax.swing.JEditorPane.setText(java.lang.String) definition code for javax.swing.JEditorPane.setText(java.lang.String)

public void setText(String sample code for java.lang.String definition code for java.lang.String  t)
Sets the text of this TextComponent to the specified content, which is expected to be in the format of the content type of this editor. For example, if the type is set to text/html the string should be specified in terms of HTML.

This is implemented to remove the contents of the current document, and replace them by parsing the given string using the current EditorKit. This gives the semantics of the superclass by not changing out the model, while supporting the content type currently set on this component. The assumption is that the previous content is relatively small, and that the previous content doesn't have side effects. Both of those assumptions can be violated and cause undesirable results. To avoid this, create a new document, getEditorKit().createDefaultDocument(), and replace the existing Document with the new one. You are then assured the previous Document won't have any lingering state.

  1. Leaving the existing model in place means that the old view will be torn down, and a new view created, where replacing the document would avoid the tear down of the old view.
  2. Some formats (such as HTML) can install things into the document that can influence future contents. HTML can have style information embedded that would influence the next content installed unexpectedly.

An alternative way to load this component with a string would be to create a StringReader and call the read method. In this case the model would be replaced after it was initialized with the contents of the string.

This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.

Overrides:
setText sample code for javax.swing.text.JTextComponent.setText(java.lang.String) definition code for javax.swing.text.JTextComponent.setText(java.lang.String) in class JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
Parameters:
t - the new text to be set; if null the old text will be deleted
See Also:
getText() sample code for javax.swing.JEditorPane.getText() definition code for javax.swing.JEditorPane.getText()

getText sample code for javax.swing.JEditorPane.getText() definition code for javax.swing.JEditorPane.getText()

public String sample code for java.lang.String definition code for java.lang.String  getText()
Returns the text contained in this TextComponent in terms of the content type of this editor. If an exception is thrown while attempting to retrieve the text, null will be returned. This is implemented to call JTextComponent.write with a StringWriter.

Overrides:
getText sample code for javax.swing.text.JTextComponent.getText() definition code for javax.swing.text.JTextComponent.getText() in class JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
Returns:
the text
See Also:
setText(java.lang.String) sample code for javax.swing.JEditorPane.setText(java.lang.String) definition code for javax.swing.JEditorPane.setText(java.lang.String)

getScrollableTracksViewportWidth sample code for javax.swing.JEditorPane.getScrollableTracksViewportWidth() definition code for javax.swing.JEditorPane.getScrollableTracksViewportWidth()

public boolean getScrollableTracksViewportWidth()
Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport.

Specified by:
getScrollableTracksViewportWidth sample code for javax.swing.Scrollable.getScrollableTracksViewportWidth() definition code for javax.swing.Scrollable.getScrollableTracksViewportWidth() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Overrides:
getScrollableTracksViewportWidth sample code for javax.swing.text.JTextComponent.getScrollableTracksViewportWidth() definition code for javax.swing.text.JTextComponent.getScrollableTracksViewportWidth() in class JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
Returns:
true if a viewport should force the Scrollables width to match its own, false otherwise

getScrollableTracksViewportHeight sample code for javax.swing.JEditorPane.getScrollableTracksViewportHeight() definition code for javax.swing.JEditorPane.getScrollableTracksViewportHeight()

public boolean getScrollableTracksViewportHeight()
Returns true if a viewport should always force the height of this Scrollable to match the height of the viewport.

Specified by:
getScrollableTracksViewportHeight sample code for javax.swing.Scrollable.getScrollableTracksViewportHeight() definition code for javax.swing.Scrollable.getScrollableTracksViewportHeight() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Overrides:
getScrollableTracksViewportHeight sample code for javax.swing.text.JTextComponent.getScrollableTracksViewportHeight() definition code for javax.swing.text.JTextComponent.getScrollableTracksViewportHeight() in class JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
Returns:
true if a viewport should force the Scrollable's height to match its own, false otherwise

paramString sample code for javax.swing.JEditorPane.paramString() definition code for javax.swing.JEditorPane.paramString()

protected String sample code for java.lang.String definition code for java.lang.String  paramString()
Returns a string representation of this JEditorPane. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString sample code for javax.swing.text.JTextComponent.paramString() definition code for javax.swing.text.JTextComponent.paramString() in class JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
Returns:
a string representation of this JEditorPane

getAccessibleContext sample code for javax.swing.JEditorPane.getAccessibleContext() definition code for javax.swing.JEditorPane.getAccessibleContext()

public AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext  getAccessibleContext()
Gets the AccessibleContext associated with this JEditorPane. For editor panes, the AccessibleContext takes the form of an AccessibleJEditorPane. A new AccessibleJEditorPane instance is created if necessary.

Specified by:
getAccessibleContext sample code for javax.accessibility.Accessible.getAccessibleContext() definition code for javax.accessibility.Accessible.getAccessibleContext() in interface Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible
Overrides:
getAccessibleContext sample code for javax.swing.text.JTextComponent.getAccessibleContext() definition code for javax.swing.text.JTextComponent.getAccessibleContext() in class JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
Returns:
an AccessibleJEditorPane that serves as the AccessibleContext of this JEditorPane