Class PortTextField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants

public class PortTextField extends WholeNumbTextField
Text Field that accepts values in a range suitable for a TCP or UDP port. To indicate if TCP or UDP is being used, call the method setTCP(boolean).

The class VTextField describes most of the usage of this class.

See Also:
  • Constructor Details

    • PortTextField

      public PortTextField()
      Class constructor.
    • PortTextField

      public PortTextField(Document doc, String text, int ncols)
      Class constructor for a document model, initial string and field size.
      Parameters:
      doc - the document model
      text - the initial text
      ncols - the number of columns in the text field.
    • PortTextField

      public PortTextField(int ncols)
      Class constructor specifying the field size..
      Parameters:
      ncols - the number of columns in the text field.
    • PortTextField

      public PortTextField(String text)
      Class constructor giving an initial string.
      Parameters:
      text - the initial text
    • PortTextField

      public PortTextField(String text, int ncols)
      Class constructor giving an initial string and field size.
      Parameters:
      text - the initial text
      ncols - the number of columns in the text field.
  • Method Details

    • setPortName

      public void setPortName(String name)
      Set a name of the port to use in error dialog boxes (the default name is TCP Port)
      Parameters:
      name - The name to display; null for the default
    • setTCP

      public void setTCP(boolean value)
      Set the protocol (TCP or UDP)
      Parameters:
      value - true if the string to use in a dialog is "TCP Port" and false if it is "UDP Port", both in the default locale
    • handleError

      protected boolean handleError()
      Handle an input error. An error is handled by creating a dialog box prompting for a legal value.
      Overrides:
      handleError in class VTextField
      Returns:
      return true if a value has been provided; false to keep the old value.
      See Also: