I solved the problem by noting the connection between the paintComponent-method, the paint-method, and the repaint-method. My code for the house and a new class is show below. (The new class was the...
Type: Posts; User: SOG
I solved the problem by noting the connection between the paintComponent-method, the paint-method, and the repaint-method. My code for the house and a new class is show below. (The new class was the...
The class I am in is called House.java and it extends JApplet - it's meant to draw the house from my textbook. (I'm not in a school-class for this - it's done by me alone for practice.) So there are...
That is what I tried to do, but I think I'll need a sample of code to figure this out - getting the paintComponent-method to work with the getX- and getY-methods as you pointed out in post number-3.
Here is how the windows/doors are handled in the code, in fact I'll give you the whole paint-method:
public void paint(Graphics g)
{
// Call the superclass...
Just so someone knows, I am trying to paint over the black windows to make them cyan, and paint red over the door. My assignment requires me to use code to paint or draw over the existing-parts, or...
What I am trying to do is draw a house with code relative to getting it's doors and windows closed when I click on them in an applet.
Here is the house I drew with code,
2305
and if you...