Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. public void agregarJuegos( int r){
  2. pnl = new JPanel();
  3. if ( !juegos.isEmpty() ) {
  4. pnl.setLocation(x, y);
  5. pnl.setSize(985, 170);
  6. pnl.setBackground(new Color(32, 40, 48) );
  7.  
  8. JLabel lbl2 = new JLabel();
  9. lbl2.setLocation(320, 5);
  10. lbl2.setSize(660, 20);
  11. lbl2.setFont( new Font("Segoe UI", Font.BOLD, 13) );
  12. lbl2.setForeground( Color.white );
  13. lbl2.setCursor( new Cursor(Cursor.HAND_CURSOR));
  14. lbl2.setText(juegos.get(r).getPer_nom());
  15. setJueSel(lbl2.getText());
  16.  
  17. lbl2.addMouseListener( new MouseListener() {
  18. @Override
  19. public void mouseClicked(MouseEvent me) {
  20. System.out.println("→"+getJueSel());
  21. pnlTiendaJuego pnlJueg = new pnlTiendaJuego();
  22. pnlJueg.setLocation(0, 0);
  23. pnlJueg.setSize(1000, 580);
  24. pnlJuegos.removeAll();
  25. pnlJuegos.add(pnlJueg);
  26. }
  27.  
  28. @Override
  29. public void mousePressed(MouseEvent me) {}
  30. @Override
  31. public void mouseReleased(MouseEvent me) {}
  32.  
  33. @Override
  34. public void mouseEntered(MouseEvent me) {
  35. lbl2.setFont(new Font("Tahoma", Font.BOLD, 14));
  36. Font font = lbl2.getFont();
  37. Map attributes = font.getAttributes();
  38. attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
  39. lbl2.setFont(font.deriveFont(attributes));
  40. System.out.println("→ " + getJueSel() + "←");
  41. }
  42.  
  43. @Override
  44. public void mouseExited(MouseEvent me) {
  45. lbl2.setFont(new Font("Tahoma", Font.BOLD, 13));
  46. Font font = lbl2.getFont();
  47. Map attributes = font.getAttributes();
  48. attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE);
  49. lbl2.setFont(font.deriveFont(attributes));
  50. }
  51. } );
  52. }
  53.  
  54. y += 180;
  55. pnl.add(lbl2);
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement