The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Graphics objects and GIF files

Posted by Hiran on November 20, 2001 at 12:13 AM

Does anyone know whether it's possible to create a graphics object w/ a GIF file? For a school project I have to create the Solitaire game, and I've been given simplified code for the GUI to start off. In one of the classes (the one that handles the card components), there's a method called paintComponent. It's signature and JavaDoc is:


/** Method which overrides paint() component. Tells the component how to actually draw itself
* @param g The graphics object which will be painted on */
void paintComponent(Graphics g)

In the Solitaire class (which deals w/ the game logic), I shuffle a deck and I want to call paintComponent to paint the GIF file associated with each unique card. Thnx in advance.
Hiran



Replies:
  • Graphics Matt Gerrans November 20, 2001 at 2:30 AM (0)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us