[2761] in java-interest

home help back first fref pref prev next nref lref last post

Creating an Image in a class which is not an Applet

daemon@ATHENA.MIT.EDU (Duncan Swain)
Thu Oct 12 20:43:31 1995

Date: Thu, 12 Oct 1995 18:44:20 -0400
From: dswain@condor.citi.doc.ca (Duncan Swain)
To: java-interest@java.Eng.Sun.COM
Cc: dswain@citi.doc.ca


Why does the Image class not have a constructor which takes a String? eg:


class Icon {
	Point location;
	static {
		Image image = new Image("doc:///dir/filename");
	}

	public Icon(int x, int y) {
		location.x = x;
		location.y = y;
	}
}


Because this class does not inherit from Applet, or have a handle on its applet (perhaps there is no applet because it is instantiated in an application), it does not have a getImage() method. Nor can Applet.getImage() be referenced statically. Short of writing an applet instead of an application, what can I do?

Any insight on this subject would greatly be appreciated!
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post