Exemple #1
0
 @Override
 public void mouseExited(MouseEvent e) {
   Object obj = e.getSource();
   if (obj instanceof JButton) {
     JButton jbtn = (JButton) obj;
     if (jbtn == jsetup) {
       jbtn.setIcon(setup[0]);
     } else if (jbtn == jclose) {
       jbtn.setIcon(close[0]);
     } else if (jbtn == jmin) {
       jbtn.setIcon(min[0]);
     } else if (jbtn == jlogin) {
       jbtn.setIcon(loginImages[0]);
     }
   } else if (obj instanceof JLabel) {
     JLabel jbl = (JLabel) obj;
     if (jbl == register) {
       jbl.setIcon(regs[0]);
     } else if (jbl == minaFind) {
       jbl.setIcon(mina[0]);
     } else if (jbl == swit) {
       jbl.setIcon(swits[0]);
     } else if (jbl == right) {
       jbl.setIcon(rights[0]);
     }
   } else if (obj instanceof JCheckBox) {
     JCheckBox jcb = (JCheckBox) obj;
     if (!jcb.isSelected()) jcb.setIcon(remPwds[0]);
     else jcb.setSelectedIcon(remPwds[3]);
   }
 }
Exemple #2
0
 @Override
 public void mousePressed(MouseEvent e) {
   Object obj = e.getSource();
   if (obj instanceof JButton) {
     JButton jbtn = (JButton) obj;
     if (jbtn == jsetup) {
       jbtn.setIcon(setup[2]);
     } else if (jbtn == jclose) {
       jbtn.setIcon(close[2]);
       System.exit(0);
     } else if (jbtn == jmin) {
       jbtn.setIcon(min[2]);
       // jdk7 setType
       mainLogin.setExtendedState(JFrame.ICONIFIED);
     } else if (jbtn == jlogin) {
       jbtn.setIcon(loginImages[2]);
     }
   } else if (obj instanceof JLabel) {
     JLabel jbl = (JLabel) obj;
     if (jbl == register) {
       jbl.setIcon(regs[2]);
     } else if (jbl == minaFind) {
       jbl.setIcon(mina[2]);
     } else if (jbl == swit) {
       jbl.setIcon(swits[2]);
     } else if (jbl == right) {
       jbl.setIcon(rights[2]);
     }
   } else if (obj instanceof JCheckBox) {
     JCheckBox jcb = (JCheckBox) obj;
     if (!jcb.isSelected()) {
       jcb.doClick();
       jcb.setSelected(true);
       jcb.setSelectedIcon(remPwds[2]);
     } else {
       jcb.doClick();
       jcb.setSelected(false);
       jcb.setIcon(remPwds[1]);
     }
   }
 }
 public void decorateLargeCheckBox(JCheckBox box) {
   box.setIcon(largeBox);
   box.setSelectedIcon(largeBoxChecked);
   box.setOpaque(false);
   box.setFocusPainted(false);
 }