Package com.amazon.kindle.kindlet.ui

Examples of com.amazon.kindle.kindlet.ui.KButton


      layout.setVgap(2);
      btnPanel.setLayout(layout);

      for (int i = 0; i < commands.size(); i++) {
        Command command = (Command) commands.get(i);
        final KButton btn = new KButton(command.getDescription());
        btn.setFont(new Font(btn.getFont().getName(), Font.BOLD, btn.getFont().getSize() + 6));
        command.setExecuter(this);
        btn.addKeyListener(command);
        // flash button
        btn.addKeyListener(new KeyListener() {
          public void keyTyped(KeyEvent e) {
          }

          public void keyPressed(KeyEvent e) {
            btn.setBackground(Color.BLACK);
            btn.repaint();
          }

          public void keyReleased(KeyEvent e) {
            btn.setBackground(Color.WHITE);
            btn.repaint();
          }
        });
        btnPanel.add(btn);
      }
View Full Code Here

TOP

Related Classes of com.amazon.kindle.kindlet.ui.KButton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.