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

Linux: Graphics.drawImage doesn't draw image.

XMLWordPrintable

    • x86
    • linux



      Name: skR10017 Date: 05/06/2000



      The following test retrieves an image from JDK Java2D demo and draws it in the frame.
      If you execute this test under
       Java HotSpot(TM) Client VM (build 1.3.0beta-b04, mixed mode ) for Linux
      you will see nothing.

      Please note that if you use drawImage(image,0,0,this) instead of used in the
      test the image will be drawn correctly.

      --------------------------test.java------------------------------
      import java.awt.*;

      public class test extends Frame
      {
          Image image;
          public test()
          {
              try
              {
                  image = Toolkit.getDefaultToolkit().getImage(new java.net.URL("file:"+
                      System.getProperty("java.home")+"/../demo/jfc/Java2D/images/cupanim.gif"));
              }
              catch(Exception e) { }
          }
          public static void main(String [] argv)
          {
              test t=new test();
              t.setSize(200,200);
              t.show();
          }
          public void paint(Graphics g) {
      g.drawImage(image,
      0,0,200,200,
      this);

          }
      }
      ------------------------------------------------------------------


      ======================================================================

            mbronsonsunw Mike Bronson (Inactive)
            kotlsunw Kotl Kotl (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: