Q&A

Q1:Is there a reason why the codebase attribute should be used in an applet tag?
A1: If all Java programs are grouped into their own subfolder, as indicated by codebase, this structure might improve the way a website is organized, but there's no other reason why using codebase is better than omitting it. The choice is a matter of personal preference.
Q2:What happens if the height and width specified for an applet don't leave enough room for the information that is displayed in the paint() method?
A2: The information will be drawn off-screen, beyond the edges of the applet window, and won't be visible at any point while the applet runs. Choosing the right dimensions for an applet is largely a matter of trial-and-error until you find the right ...

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.