Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public LibraryGui(){
- this.addKeyListener(new KeyAdapter(){
- @Override
- public void keyPressed(KeyEvent e){
- switch(e.getKeyCode()){
- case KeyEvent.VK_A:
- try{
- l.addItem();
- }catch(IOException e1){
- JOptionPane.showMessageDialog(null, "Action could not be done.", "Error", JOptionPane.ERROR_MESSAGE);
- }
- update();
- case KeyEvent.VK_D:
- try{
- l.deleteItem();
- }catch(IOException e1){
- JOptionPane.showMessageDialog(null, "Action could not be done.", "Error", JOptionPane.ERROR_MESSAGE);
- }
- update();
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement