Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Q&A

  1. Is there a limit to the point size that can be used for text?

    The limiting factor is the height and width of your component. Point sizes typically range from 9-point text for small lines that are readable to 48-point text for large headlines. Choosing the right size depends on the font typeface as well as the size, so it's largely a matter of trial and error.

  2. What happens if a color defined in a Java program can't be displayed on the monitor of someone displaying the program? For example, if my monitor is set to display only 256 colors, what will occur if I choose one of the 16.5 million colors that isn't in those 256?

    When a monitor can't display a color selected with a setColor() or setBackground() method, it shows the closest existing color as a substitute. An example of this kind of substitution is the Danger application, which runs differently depending on the number of colors that can be shown as the text cycles from black to light blue to white.

Share ThisShare This

Informit Network