Examples of addKeyListener()


Examples of javax.swing.JEditorPane.addKeyListener()

        query.setContentType("text/sql");
        query.setBackground(Color.white);
        query.setFont(new Font("Verdana", 0, 12));
        query.setEditable(true);

        query.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                queryKeyReleased(evt,false);
            }
           
            public void keyPressed(java.awt.event.KeyEvent evt) {
View Full Code Here

Examples of javax.swing.JFormattedTextField.addKeyListener()

 
  public static JFormattedTextField createIntegerField(int minValue, int maxLength) {
    IntegerFormatter formatter = new IntegerFormatter(minValue);
    JFormattedTextField field = new JFormattedTextField(formatter);
    field.setHorizontalAlignment(JTextField.CENTER);
    field.addKeyListener(new FieldListener(maxLength));
    return field;
  }
 
  @SuppressWarnings("serial")
  private static class IntegerFormatter extends AbstractFormatter {
View Full Code Here

Examples of javax.swing.JFrame.addKeyListener()

                frame.add(videoComponent, BorderLayout.CENTER);
                //
                // Propagate key events.  This could be done with focus, but this
                // test uses the same code as used in VideoPlayer.
                //
                frame.addKeyListener(new KeyAdapter() {

                    public void keyPressed(KeyEvent evt) {
                        for (KeyListener l : videoComponent.getKeyListeners()) {
                            l.keyPressed(evt);
                        }
View Full Code Here

Examples of javax.swing.JList.addKeyListener()

               String [] matches = scalaExec.Interpreter.GlobalValues.autoCompletionScalaSci.getMatched(inputString);

                final JList  resultsList = new JList(matches);
                autocompleteListHandler  detailHelpAdapter = new autocompleteListHandler();
                resultsList.addKeyListener(detailHelpAdapter);


                resultsList.addListSelectionListener(new ListSelectionListener() {
                         public void valueChanged(ListSelectionEvent e) {
                             String  selValue = resultsList.getSelectedValue().toString();
View Full Code Here

Examples of javax.swing.JMenu.addKeyListener()

     */
    public JMenuBar menuBar(Game game) {
      JMenuBar menuBar = new JMenuBar();
      JMenu menu = new JMenu("Options");
      menu.addMouseListener(new MyMouseListener(this.game));
      menu.addKeyListener(new MyKeyListener(this.game));
      menu.addMouseMotionListener(new MyMouseMotionListener(this.game));
      menuBar.add(menu);
      // Add restart menu item
      JMenuItem restart = new ActionMenuItem(new RestartAction(concentration));     
      menuBar.add(Box.createHorizontalGlue());
View Full Code Here

Examples of javax.swing.JPanel.addKeyListener()

        glEvents = new Tutorial2(obj, fm, p);
    }
   
    glScene.addGLEventListener(glEvents);
   
    r.addKeyListener(glEvents);
    r.addMouseListener(glEvents);
    glScene.addKeyListener(glEvents);
    glScene.addMouseListener(glEvents);
   
    r.add(glScene, BorderLayout.CENTER);
View Full Code Here

Examples of javax.swing.JPasswordField.addKeyListener()

       
        // select the component's text
        textfield.selectAll();
       
        // add a key listener
        textfield.addKeyListener(new PasswordListener());
       
        // return the component
        return textfield;
    }
   
View Full Code Here

Examples of javax.swing.JRadioButton.addKeyListener()

      optIATGaussian.setHorizontalAlignment(SwingConstants.LEFT);
      optIATGaussian.setActionCommand("IAT_GAUSS");
      optIATGaussian.setPreferredSize(new Dimension(100, 20));
      optIATGaussian.setMinimumSize(new Dimension(100, 20));
      optIATGaussian.setMaximumSize(new Dimension(100, 20));
      optIATGaussian.addKeyListener(this);
     
      groupIAT.add(optIATConstant);
      groupIAT.add(optIATPoisson);
      groupIAT.add(optIATGaussian);
View Full Code Here

Examples of javax.swing.JRootPane.addKeyListener()

                if (pane.requestFocus(true)) {
                    previousFocusOwner = focusOwner;
                    focusedRootPane = pane;
                    MenuKeyBindingProcessor.attach();
                    if (pane.getJMenuBar() == null) {
                        pane.addKeyListener(createRootPaneKeyListener());
                    }
                }
                break;
            }
        }
View Full Code Here

Examples of javax.swing.JScrollPane.addKeyListener()

    document.addDocumentListener(new ScrollDocumentToEnd(textArea));

    JScrollPane scrollPane = new JScrollPane(textArea);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPane.setPreferredSize(new Dimension(300, 100));
    scrollPane.addKeyListener(handler);
    panel.add(scrollPane, BorderLayout.SOUTH);

    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
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.