Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void agregarJuegos( int r){
- pnl = new JPanel();
- if ( !juegos.isEmpty() ) {
- pnl.setLocation(x, y);
- pnl.setSize(985, 170);
- pnl.setBackground(new Color(32, 40, 48) );
- JLabel lbl2 = new JLabel();
- lbl2.setLocation(320, 5);
- lbl2.setSize(660, 20);
- lbl2.setFont( new Font("Segoe UI", Font.BOLD, 13) );
- lbl2.setForeground( Color.white );
- lbl2.setCursor( new Cursor(Cursor.HAND_CURSOR));
- lbl2.setText(juegos.get(r).getPer_nom());
- setJueSel(lbl2.getText());
- lbl2.addMouseListener( new MouseListener() {
- @Override
- public void mouseClicked(MouseEvent me) {
- System.out.println("→"+getJueSel());
- pnlTiendaJuego pnlJueg = new pnlTiendaJuego();
- pnlJueg.setLocation(0, 0);
- pnlJueg.setSize(1000, 580);
- pnlJuegos.removeAll();
- pnlJuegos.add(pnlJueg);
- }
- @Override
- public void mousePressed(MouseEvent me) {}
- @Override
- public void mouseReleased(MouseEvent me) {}
- @Override
- public void mouseEntered(MouseEvent me) {
- lbl2.setFont(new Font("Tahoma", Font.BOLD, 14));
- Font font = lbl2.getFont();
- Map attributes = font.getAttributes();
- attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
- lbl2.setFont(font.deriveFont(attributes));
- System.out.println("→ " + getJueSel() + "←");
- }
- @Override
- public void mouseExited(MouseEvent me) {
- lbl2.setFont(new Font("Tahoma", Font.BOLD, 13));
- Font font = lbl2.getFont();
- Map attributes = font.getAttributes();
- attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE);
- lbl2.setFont(font.deriveFont(attributes));
- }
- } );
- }
- y += 180;
- pnl.add(lbl2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement