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

MetalToolBarUI.setDragOffset throws HeadlessException

    Details

    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      sparc
    • OS:
      solaris_7

      Description



      Name: sdR10048 Date: 01/26/2001


      public void javax.swing.plaf.metal.MetalToolBarUI.setDragOffset(Point)
      throws unspecified HeadlessException in headless mode.

      Javadoc says:
      --------------------------------------------------
      protected void setDragOffset(Point p)

      See example:
      --------------------------------------------------
      [falcon] ~/tmp
      % cat Test.java
      import java.awt.*;
      import javax.swing.*;
      import javax.swing.plaf.metal.*;
      public class Test extends MetalToolBarUI {
          public void setDragOffset(Point point) {
              super.setDragOffset(point);
          }
          public static void main(String[] args) {
              Test c = new Test();
              JToolBar toolBar = new JToolBar();
              c.installUI(toolBar);
              c.setDragOffset(new Point(0,0));
          }
      }

      [falcon] ~/tmp
      % java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b48)
      Java HotSpot(TM) Client VM (build 1.4beta-B48, mixed mode)

      [falcon] ~/tmp
      % javac Test.java

      [falcon] ~/tmp
      % java -Djava.awt.headless=true Test
      Exception in thread "main" java.awt.HeadlessException
              at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:115)
              at java.awt.Window.<init>(Window.java:248)
              at java.awt.Frame.<init>(Frame.java:321)
              at javax.swing.JFrame.<init>(JFrame.java:180)
              at javax.swing.plaf.basic.BasicToolBarUI.createFloatingFrame(BasicToolBarUI.java:420)
              at javax.swing.plaf.basic.BasicToolBarUI.createDragWindow(BasicToolBarUI.java:437)
              at javax.swing.plaf.metal.MetalToolBarUI.setDragOffset(MetalToolBarUI.java:123)
              at Test.setDragOffset(Test.java:6)
              at Test.main(Test.java:12)
      --------------------------------------------------
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              leifs Leif Samuelsson (Inactive)
              Reporter:
              dsvsunw Dsv Dsv (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: