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

MenuShortcut.toString() throws HeadlessException

XMLWordPrintable

    • beta
    • sparc
    • solaris_7



      Name: sdR10048 Date: 01/22/2001


      public String java.awt.MenuShortcut.toString()
      throws unexpected HeadlessException in headless mode.

      Javadoc says:
      --------------------------------------------------
      public String toString()

           Returns an internationalized description of the MenuShortcut.
           Overrides:
               toString in class Object
           Returns:
               a string representation of this MenuShortcut.
           Since:
               JDK1.1

      See example:
      --------------------------------------------------
      dsv@falcon ~/tmp
      % cat Test.java
      import java.awt.*;
      import java.awt.event.*;

      public class Test {
          public static void main(String[] args) {
              MenuShortcut menusc = new MenuShortcut(KeyEvent.VK_A);
              try {
                  System.out.println(menusc.toString());
              } catch (Exception e) {
                  System.out.println(e);
              }
          }
      }

      dsv@falcon ~/tmp
      % javac Test.java

      dsv@falcon ~/tmp
      % java -Djava.awt.headless=true Test
      java.awt.HeadlessException
      ^C

      dsv@falcon ~/tmp
      % java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b46)
      Java HotSpot(TM) Client VM (build 1.4beta-B45, mixed mode)
      --------------------------------------------------
      ======================================================================

            mmartaksunw Michael Martak (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: