Class URLTextAreaPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class URLTextAreaPane extends JComponent
Text area component loadable from multiple sources. This component provides a text area whose contents can be entered directly or loaded from a location specified by a file name or a URL. When a URL is used, the text is not editable, although a control allows one to dissociate the text from the URL, in which case the text can be edited.
See Also:
  • Constructor Details

    • URLTextAreaPane

      public URLTextAreaPane(int rows, int cols, String errorTitle)
      Constructor.
      Parameters:
      rows - the number of rows in the text area
      cols - the number of columns in the text area
      errorTitle - the title to use for dialog boxes reporting errors
  • Method Details

    • getURL

      public String getURL()
      Get the URL.
      Returns:
      the URL; null if there is none
    • getText

      public String getText()
      Get the text for the component.
      Returns:
      the text.
    • urlInUse

      public boolean urlInUse()
      Determine if the text is associated with a URL.
      Returns:
      true if the text is the contents of a uRL; false otherwise
    • setEnabled

      public void setEnabled(boolean enabled)
      Overrides:
      setEnabled in class JComponent
    • isEnabled

      public boolean isEnabled()
      Overrides:
      isEnabled in class Component
    • init

      public void init(String urlOrText, boolean isURL)
      Initialize the component.
      Parameters:
      urlOrText - either the URL or the component's text
      isURL - true of the first argument is a URL; false if it is text
    • init

      public void init(String urlOrText, boolean isURL, String errorTitle)
      Initialize the component specifying a new error title.
      Parameters:
      urlOrText - either the URL or the component's text
      isURL - true of the first argument is a URL; false if it is text
      errorTitle - the title to use on error-related dialog boxes