I want to control my buttons in keys instead of mouse.for that I have used setMnemonic.but now too its not working.here is my code.pls correct the code and help me.
public class AstMonitor extends JApplet implements
ActionListener, Runnable {
Thread astThread;
JButton logout = new JButton("logout");
public void init() {
GridLayout gl;
getContentPane().setLayout(new GridLayout(3,10));
logout.setActionCommand("logout");
logout.addActionListener(this);
logout.setMnemonic('l');
this.getContentPane().add(logout);
logout.setBackground(Color.pink);
astThread = new Thread(this);
astThread.start();
}
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
String thebase = "http://" + getCodeBase().getHost();
if (command.equals("logout")) {
getAppletContext().showDocument(String2Url(thebase + "/crm/crmlogin.html"),"_parent");
actionSocket("Logoff",true,getParameter("thehost"),getParameter("station"),getParameter("manageruser"),getParameter("managerpass"));
stop();
}
Thanks..