Drawing text
Navigate User Interface topic: ) |
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);
}
}
|