Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about GUI & Images

Status
Not open for further replies.

Gloomer

Programmer
May 20, 2005
1
US
Well, I am working on a Blackjack game for a lab. I have it all coded, and it works, but I am just using a standard JFrame GUI and text output. I have .gif files for all of the card pictures, and I have a method that will add them into a 2 dimensional array like I want. But my trouble is in the implication of the pictures which has to do with the GUI.

I am wondering, what would be a better type to use, instead of JFrame, I need one that allows me to specifically put where I want things to be loaded... a Label, text box, whichever I want to be able to say, add(label, 1,1, this) or similar to move things, and load things where I need.

My second problem is I dont exactly know how to draw the images. I can do it with paint() in an applet just by the standard g.draw etc etc, But I am not too sure how to do that with just an application. I tried similar, but with my current JFrame GUI it wasnt showing up properly so I was not sure if that was workign right or not. I would need to be able to repaint or redraw each time a new card is drawn etc.

If someone could tell me which type of GUI I should research into and if the paint() method is what I should use to display the images, or which one I should use that would be great.

Thanks,
Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top