Advertisement
Guest User

Avatar

a guest
May 29th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. package com.boyko.codemefast;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Font;
  5.  
  6. import javax.swing.ImageIcon;
  7. import javax.swing.JLabel;
  8. import javax.swing.JPanel;
  9.  
  10. public class AvatarPanel extends JPanel {
  11. private ImageIcon avatar = new ImageIcon(getClass().getResource("Icons/avatar.jpg"));
  12.  
  13. public AvatarPanel(String level,String name,String xPoints) {
  14. setLayout(null);
  15. setBackground(Color.WHITE);
  16. JLabel avatarLbl = new JLabel();
  17. avatarLbl.setBounds(5, 5, 80, 85);
  18. avatarLbl.setIcon(avatar);
  19. add(avatarLbl);
  20. JLabel levelLbl = new JLabel("Level: " + level);
  21. levelLbl.setFont(new Font("Serif", Font.ITALIC, 15));
  22. levelLbl.setBounds(80, 15, 70, 30);
  23. add(levelLbl);
  24. JLabel avatarName = new JLabel(name);
  25. avatarName.setBounds(80, 33, 70, 30);
  26. avatarName.setFont(new Font("Serif", Font.ITALIC, 15));
  27. add(avatarName);
  28. JLabel xp = new JLabel("XP: "+xPoints);
  29. xp.setBounds(80, 50, 70, 30);
  30. xp.setFont(new Font("Serif", Font.ITALIC, 15));
  31. add(xp);
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement