Drawing text

From Wikibooks, open books for an open world
Jump to: navigation, search

Drawing complex shapes Java Programming/Graphics
Drawing text
Understanding gradients
Navigate User Interface topic:v  d  e )


Computer code Code listing 9.5: Drawing text
public class MyCanvas extends Canvas {
    public void init() {
        setFont("Times New Roman", Font.PLAIN, 24);
        setColor(Color.white);
        setBackGroundColor(Color.black);
        setLayout(new GridLayout);
 
        add(label);
        add(button);
    }
}


Drawing complex shapes Java Programming/Graphics
Drawing text
Understanding gradients