Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. class TestTest extends Frame {
  2.  
  3. Font myFont = new Font("Rockwell Nova", Font.PLAIN, 12);
  4. Graphics2D g2d;
  5.  
  6. public TestTest() {
  7.  
  8. Label myLabel = new Label() {
  9. public void update(Graphics g) { paint(g); }
  10. public void paint(Graphics g) {
  11. g.setFont(myFont);
  12. g.drawString("ROBOTO CONDENSED, THIS DOES NOT WORK!", 0, 20);
  13. }
  14. };
  15. setSize(500,200);
  16. setLocation(10,10);
  17. setUndecorated(false);
  18.  
  19. myLabel.setBackground(Color.red);
  20.  
  21. add(myLabel, BorderLayout.SOUTH);
  22. setVisible(true);
  23.  
  24. }
  25.  
  26. public void paint(Graphics g) {
  27.  
  28. g2d = (Graphics2D) g;
  29. g2d.setStroke(new BasicStroke(0.0f));
  30.  
  31. g2d.setFont(myFont);
  32. g2d.setColor(Color.BLACK);
  33. g2d.drawString("ROBOTO CONDENSED THIS WORKS!",50, 50);
  34.  
  35. }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement