0

Hey Guys i want to create keyUp and keyDown Events on JTable to get value at particular cell as i press up key and Down Key ,i tried to do it and succeeded in KeyDown Event which is :

ProductTable.addKeyListener(new KeyAdapter()  {
                   public void keyPressed(KeyEvent k){
                      ProductTable_KeyPressed(k);
                    }
                });    
  
   private void ProductTable_KeyPressed(KeyEvent k)
     {
        int Row=  ProductTable.getSelectedRow();
        String ProductName=   ProductTable.getValueAt(Row+1,0).toString();
        JProduct_name_txt1.setText(ProductName);
     }

But Having problem in Making keyup Event....Could any one give Help on This.
I'll be thankful

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by JamesCherrill
0

Its just more of the same...

ProductTable.addKeyListener(new KeyAdapter()  {
                   public void keyPressed(KeyEvent k){
                      ProductTable_KeyPressed(k);
                    }
                   public void keyReleased(KeyEvent k){
                      // do whatever you want with key released event
                    }
                });
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.