This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc/gcj 3.4 - bug report - test case


I tried sending this as an attachment, and it failed. So here is the plain text 
version. To actually run the program, just place a .gif and .png file in the same 
directory named new.gif and new.png. Any old image will do.
Here is the test case:

import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;

/**
 * Date: Jul 17, 2003
 * Time: 8:46:02 PM
 */
public class SwtTest1
{

    public static void main (String [] args) {
        Display display = new Display ();
        Shell shell = new Shell (display);

        Image image = new Image(display, "new.png");
        System.out.println("loaded png just fine");
        image.dispose();
        image = new Image(display, "new.gif");
        System.out.println("loaded gif fine.");
        image.dispose();
        shell.open ();
        while (!shell.isDisposed ()) {
            if (!display.readAndDispatch ()) display.sleep ();
        }
        image.dispose ();
        display.dispose ();
    }
}

Thanks
Moh



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]