Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Working with the User > Drawing with the mouse

Drawing with the mouse

In this example, the applet does nothing at all until the user takes an action. Consequently, everything takes place within event handlers, where the Java applet handles the events that are triggered when the user presses the mouse button, drags the mouse, and releases the button. Listing 7.1 and Applet 7.1 allow the user to draw the line.

Listing 7.1. Putting a table with a border of I around an applet helps to show the applet's boundaries.



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint