SHARE
TWEET

Untitled

a guest Jan 11th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public  class MainFrame extends JFrame{
  2.         JPanel contentPanel;
  3.  
  4.         public MainFrame(){}
  5.  
  6.        contentPanel = new JPanel();
  7.        contentPanel.setLayout(new CardLayout());
  8.        contentPanel.removeAll();
  9.        contentPanel.add(new ContentPanel1());
  10.        contentPanel.repaint();
  11.        contentPanel.revalidate()
  12.  
  13.  }
  14.    
  15. public class WorkPlace extends JPanel implements key{
  16.   public WorkPlace(){
  17.            panel.setFocusable(true);
  18.             panel.requestFocusInWindow();
  19.       }
  20.                @Override
  21.                 public void keyTyped(KeyEvent e) {}
  22.  
  23.                 @Override
  24.                 public void keyReleased(KeyEvent e) {}
  25.  
  26.                 @Override
  27.                 public void keyPressed(KeyEvent e) {
  28.                     System.out.println("Pressed " + e.getKeyChar());
  29.                 }        
  30.  
  31.  
  32.  
  33.   }
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top