Docstoc

Homework

Document Sample
Homework Powered By Docstoc
					                                    Homework

You are create an applet. Using the paint class, you will create a house with 4 windows.
The windows of your house are to open one after another and finally a door.

Secondly, The windows and the door will be controlled by one single scrollbar. There
will also be a button “Reset” this will open all the windows and the door with one press
of the button. You must also reset the scrollbar to have a value of 0.

Thirdly, you are to add a button on the door labeled “Knock”. After you click the button
three times, a picture of something will appear.

Things to note…

You must implement adjustmentListener, actionlistener


In JBinit()
       Object = new Button(“Kncok”);
       Add(Object)
       Object.addActionlistener(this);
       Image = getImage(getDocumentBase(),”NameofPic.gif”);




Paint()

       Object.setLocation(x,y);
       Object.setColor(Color.blue);
       g.drawImage(image,20,20,100,100,this);
OR
       g.drawImage(image,x,y,null);

actionPerformed(ActionEvent e)
       if (e.getsource == Object)
          yada yada yada

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:12/11/2011
language:
pages:1