-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.0, 1.1.7
-
other, x86
-
generic, windows_nt
Name: keC81026 Date: 02/05/99
to reproduce
1. Get an image that attached to the bug No.4189672,rename it to
1.gif
2. compile and run StarImageApp.java
3. Note, that image does not displaying, though PhotoShop,
ACDSee, Netscape displays it
===================== StarApplication.java ===============
import StarFrame;
public class StarApplication {
public StarApplication( ) {
};
public static void main( String argv[] ) {
StarFrame f = new StarFrame( );
};
}
===========================================================
==================== StarFrame.java =======================
import java.awt.*;
import StarPanel;
public class StarFrame extends Frame {
public StarFrame( ) {
StarPanel p = new StarPanel();
setLayout( new BorderLayout() );
add("Center", p );
show( );
resize( p.getPreferredSize( ) );
};
};
===========================================================
======================= StarPanel.java ====================
import java.awt.*;
import java.awt.image.*;
import java.applet.*;
import java.net.*;
public class StarPanel extends Panel {
public static Image starImage;
static
{
try {
starImage = Toolkit.getDefaultToolkit().getImage("1.gif");
} catch (Exception e) {
System.out.println("Couldn't load images: " + e);
}
}
public StarPanel( ) {
init();
};
public void init( ) {
resize( getPreferredSize() );
};
public void paint( Graphics g ) {
g.drawImage( starImage, 0, 0, this );
};
public Dimension getPreferredSize( ) {
return( new Dimension (500,500) );
};
};
===========================================================
======================================================================