English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Here is the code i want to modify. I want the dice to show as images instead of being drawn. How could I go about doing that?

http://www.webbasedprogramming.com/Teach-Yourself-Java-1.1-Programming-in-24-Hours/html/ch22.htm#Heading15

2006-11-08 18:29:36 · 1 answers · asked by h2gj87 4 in Computers & Internet Programming & Design

1 answers

This part here displays the die:

21: public void paint(Graphics screen) {
22: die1.drawDie(screen, 5, 50);
23: die2.drawDie(screen, 175, 50);

You could try replacing "die1" and "die2" with the image name and make sure you PUT THE IMAGES IN THE SAME FOLDER. Lol, could be very important.

However, this:
1: import java.awt.*;
2: import java.awt.event.*;

...could hold reference to the images in question and might have to create whatever an .awt file is.

2006-11-08 20:08:38 · answer #1 · answered by __ 3 · 0 0

fedest.com, questions and answers