File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes setMnemonic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "setMnemonic" Watch "setMnemonic" New topic
Author

setMnemonic

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setMnemonic