• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setMnemonic

 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Beware the other head of science - it bites! Nibble on this message:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic