Examples of addKeyListener()


Examples of java.awt.Container.addKeyListener()

  if (root != null) {
      root.registerKeyboardAction(this, "cancel",
          KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
          JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
  } else if (top != null) {
      top.addKeyListener(pka);
  }
  window.getRootPane().registerKeyboardAction(this, "cancel",
                KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
                JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
 
View Full Code Here

Examples of java.awt.Frame.addKeyListener()

        MediaPlayerFactory factory = new MediaPlayerFactory();

        final EmbeddedMediaPlayer mediaPlayer = factory.newEmbeddedMediaPlayer();
        mediaPlayer.setVideoSurface(factory.newVideoSurface(vs));

        f.addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent e) {
                switch(e.getKeyCode()) {
                    case KeyEvent.VK_F11:
                        mediaPlayer.enableOverlay(!mediaPlayer.overlayEnabled());
View Full Code Here

Examples of java.awt.Panel.addKeyListener()

        setLayout(new BorderLayout());
        addKeyListener(this);

        Panel p = new Panel(new GridLayout(6, 2, 10, 10));

        p.addKeyListener(this);
        p.setBackground(SystemColor.control);
        p.add(createLabel("Type:"));

        Choice types = new Choice();
View Full Code Here

Examples of java.awt.Window.addKeyListener()

  Random rand = new Random();
 
  public void init() {
    super.init();
    Window w = sm.getFullScreenWindow();
    w.addKeyListener(this);
    w.setFocusTraversalKeysEnabled(false);
   
    Graphics2D g = this.g;
   
    fire.load("res\\raw\\smb_bowserfire.wav");
View Full Code Here

Examples of javax.media.opengl.GLCanvas.addKeyListener()

     * para os eventos Gl, de mouse e teclado
     */
    GLCanvas canvas = new GLCanvas(glCaps);
    add(canvas,BorderLayout.CENTER);
    canvas.addGLEventListener(renderer);       
    canvas.addKeyListener(renderer);
    //canvas.addMouseMotionListener(renderer);
    //canvas.addMouseListener(renderer);
    canvas.requestFocus();     
  }   
 
View Full Code Here

Examples of javax.media.opengl.awt.GLCanvas.addKeyListener()

            drawable = newt;
        } else {
            final GLCanvas glCanvas = new GLCanvas(glcaps);

            final AwtListener listener = new AwtListener();
            glCanvas.addKeyListener(listener);
            glCanvas.addMouseListener(listener);
            glCanvas.addMouseMotionListener(listener);
            glCanvas.addMouseWheelListener(listener);

            drawable = glCanvas;
View Full Code Here

Examples of javax.swing.JButton.addKeyListener()

      Index index = new Index(i, j);
      index2Argument.put(index, a);
      argument2Index.put(a, index);
      index2Button.put(index, button);
      button.addActionListener(this);
      button.addKeyListener(this);
      if (j==0) {
        if (panel!=null) {
          add(panel);
        }
        panel = new JPanel();
View Full Code Here

Examples of javax.swing.JCheckBox.addKeyListener()

  public void createComponent()
  {
    JCheckBox c = new JCheckBox();

    c.setEnabled(!readonly);
    c.addKeyListener(this);
    c.addChangeListener(this);
    c.addFocusListener(this);

    component = c;
  }
View Full Code Here

Examples of javax.swing.JComboBox.addKeyListener()

                        case java.sql.Types.BOOLEAN:
                        case java.sql.Types.BIT:
                            jcb = new JComboBox(bool);
                            jcb.setOpaque(true);
                            jcb.setPreferredSize(dimTexto);
                            jcb.addKeyListener(commandKeyListener);
                            jp2.add(jcb,BorderLayout.CENTER);
                            hmTemp.put("contenido", jcb);

                            jl = new JLabel(hmTemp.get("TYPE_NAME").toString());
                            jl.setPreferredSize(dimTipo);
View Full Code Here

Examples of javax.swing.JComponent.addKeyListener()

        // this.comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
        // it probably breaks various things
       
        // hitting enter in the combo box should stop cellediting
        JComponent editorComponent = (JComponent) comboBox.getEditor().getEditorComponent();
        editorComponent.addKeyListener(handler);
        // remove the editor's border - the cell itself already has one
        editorComponent.setBorder(null);

        // editor component might change (e.g. a look&feel change)
        // the new editor component needs to be modified then (keyListener, border)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.