Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4158610

Weak toString method in Swing components

XMLWordPrintable

    • 1.2fcs
    • sparc
    • solaris_2.6
    • Not verified

      It would be really nice if you'd implement a usable toString in
      the Swing api. I wouldn't take much. The 1.1 awt 'Component'
      implements toString and calls paramString. Simply override paramString in
      each JComponent as in the following sample code for JLabel.

      protected String paramString() {
      return super.paramString() +
        ",mnemonic=" + mnemonic +
           ",text=" + text +
           ",defaultIcon=" + defaultIcon +
           ",disabledIcon=" + disabledIcon +
           ",verticalAlignment=" + verticalAlignment +
           ",horizontalAlignment=" + horizontalAlignment +
           ",verticalTextPosition=" + verticalTextPosition +
           ",horizontalTextPosition=" + horizontalTextPosition +
           ",iconTextGap=" + iconTextGap;
          }
      From Tom Crosman <###@###.###>

            malberssunw Michael Albers (Inactive)
            malberssunw Michael Albers (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: