Guest User

Untitled

a guest
Mar 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import java.applet.*;
  2. import java.awt.*;
  3. public class CenteredText extends Applet
  4. {
  5. final Font f = new Font ("SansSerif", Font.BOLD, 18);
  6. public void paint(Graphics g)
  7. {
  8. Dimension d = this.getSize();
  9. g.setColor (Color.white);
  10. g.fillRect (0, 0, d.width, d.height);
  11. g.setColor (Color.black);
  12. g.setFont(f);
  13. g.drawString("WELCOME", 100, 100);
  14. g.drawRect (0, 0, d.width - 1, d.height - 1);
  15. }
  16.  
  17. }
Add Comment
Please, Sign In to add comment