getGraphics() method does not exist for SplashScreen

Hello

I'm trying to use the SplashScreen Class. I have found a sample in the SDN article :http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/splashscreen/

It shows the following code :

SplashScreen splash = SplashScreen.getSplashScreen();

[b]Graphics2D g = (Graphics2D)splash.getGraphics();[/b]

Dimension size = splash.getDimension();

g.setComposite(AlphaComposite.Clear);

g.fillRect(0, 0, size.width, size.height);

g.setPaintMode();

Within theSplashTest sample , there is the same call to this method.

However, it seems that the getGraphics() method does not exist. Instead I have found another one called : createGraphics(). Has the method been renamed ?

Thanks

[781 byte] By [martinelligegea] at [2007-11-26 17:39:43]
# 1

> Has the method been renamed ?

I don't use JDK6, but methds don't get renamed for backward compatibilty reasons, so I doubt it has been renamed.

> However, it seems that the getGraphics() method does not exist

a) Look at the API.

b) Click on the "Index" link

c) Click on "G"

d) search for "getGraphics" to see which classes have the method

Basic problem solving.

camickra at 2007-7-9 0:07:52 > top of Java-index,Desktop,Core GUI APIs...
# 2

> I don't use JDK6, but methds don't get renamed

> for backward compatibilty reasons, so I doubt

> it has been renamed.

Apparently this one got renamed before the API was finalized (but after that article was written).

@OP: yes, createGraphics() is what you should be using.

uncle_alicea at 2007-7-9 0:07:52 > top of Java-index,Desktop,Core GUI APIs...