Menu

[solved]-Code Java Public Class Prod Implements Keylistener Public Void Keypressed Keyevent E Switc Q39055180

what does this code do in java:

public class prod implements KeyListener {
       public void keyPressed(KeyEvente){
          switch(e.getKeyCode())
           {
           caseKeyEvent.VK_Q:
              Buttons[0].doClick();
              break;
           caseKeyEvent.VK_L:
              Buttons[1].doClick();
              break;

default: break;

Why is it that we can do any VK_ any alphabet and it works?

Also how is the above different from:

switch(a[i])
           {
           case(“W”):
              Buttons[i].setMnemonic(KeyEvent.VK_A);
           break;

default: break;

Expert Answer


Answer to what does this code do in java: public class prod implements KeyListener { public void keyPressed(KeyEvent e){ switch(e…. . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *