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

java.awt.font.TextLayout example uses doubles where floats required

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • docs
    • beta
    • generic
    • generic



      Name: krC82822 Date: 09/30/2000


      java version "1.2.2"
      Classic VM (build 1.2.2_006, green threads, nojit)



      Example code found in the API-doc of java.awt.font.TextLayout reads

      Graphics2D g = ...;
               Point2D loc = ...;
               Font font = Font.getFont("Helvetica-bold-italic");
               FontRenderContext frc = g.getFontRenderContext();
               TextLayout layout = new TextLayout("This is a string", font, frc);
               layout.draw(g, loc.getX(), loc.getY());

      Point2D.get{X,Y}() return double values, but TextLayout.draw() requires two
      float values as arguments.
      Thus, this example won't run.
      (Review ID: 110033)
      ======================================================================

            jballsunw Jennifer Ball (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: