Package java.awt.event

Examples of java.awt.event.KeyAdapter


        assertTrue(eventProcessed);
    }

    public final void testGetListeners() {
        assertEquals(0, choice.getListeners(KeyListener.class).length);
        KeyAdapter listener = new KeyAdapter(){};
        choice.addKeyListener(listener);
        Class<KeyListener> clazz =  KeyListener.class;
        assertEquals(1, choice.getListeners(clazz).length);
        assertEquals(listener, choice.getListeners(clazz)[0]);
        choice.removeKeyListener(listener);
View Full Code Here


    /*
     * Test method for 'java.awt.TextComponent.processEvent(AWTEvent)'
     */
    public void testProcessEvent() {
        eventProcessed = false;
        textComp.addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent a0) {
                eventProcessed = true;
            }
        });
View Full Code Here

    public AboutDialog(Frame owner){
        super(owner);
        buildGUI();

        addKeyListener(new KeyAdapter(){
                public void keyPressed(KeyEvent e){
                    if(e.getKeyCode() == KeyEvent.VK_ESCAPE){
                        setVisible(false);
                        dispose();
                    }
View Full Code Here

                                                  50 );
            tf.setFont( new Font( "monospaced",
                                  Font.PLAIN,
                                  12 ) );

            tf.addKeyListener( new KeyAdapter() {
                public void keyPressed(KeyEvent e)
                {
                    if ( e.getKeyCode() == KeyEvent.VK_ENTER ) {
                        okButt.doClick();
                        return;
View Full Code Here

                                                      Translater
                                                              .getString("login.rememberBox"));
   
    public SimpleLoginPage()
    {
        userName.addKeyListener(new KeyAdapter() {
           
            public void keyPressed(KeyEvent e)
            {
                statusText.setText(null);
            }
        });
       
        password.addKeyListener(new KeyAdapter() {
           
            public void keyPressed(KeyEvent e)
            {
                statusText.setText(null);
            }
View Full Code Here

        fullScreenHostFrame = new HostFrame();
        fullScreenHostFrame.setUndecorated(true);

        // Add a key listener to the display host to toggle between full-screen
        // and windowed mode
        primaryDisplayHost.addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent keyEvent) {
                if (keyEvent.getKeyCode() == KeyEvent.VK_F
                    && (keyEvent.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) > 0
                    && (keyEvent.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) > 0) {
View Full Code Here

        {
//            JPanel panel = new JPanel();
//            getContentPane().add(panel, BorderLayout.CENTER);
          JPanel execPath=new JPanel();
            txtExecPath = new XBayaTextField();
            txtExecPath.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setExecutablePath(txtExecPath.getText());
                }
            });
            txtExecPath.getTextField().addFocusListener(new FocusAdapter() {
              @Override
              public void focusLost(FocusEvent e) {
                super.focusLost(e);
                updateTempDirWithExecPath(txtExecPath.getText());
              }
      });
            txtExecPath.setColumns(10);
            btnExecBrowse=new JButton(MenuIcons.OPEN_ICON);
            btnExecBrowse.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed(ActionEvent arg0) {
          JFileChooser c = new JFileChooser();
          int rVal = c.showOpenDialog(null);
          if (rVal == JFileChooser.APPROVE_OPTION) {
            txtExecPath.setText(c.getSelectedFile().toString());
            setExecutablePath(txtExecPath.getText());
          }
        }
            });
            execPath.add(txtExecPath.getSwingComponent());
            execPath.add(btnExecBrowse);
            JButton btnIOParameters = new JButton("IO Parameters...");
            btnIOParameters.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed(ActionEvent event) {
          try {
                        ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),getServiceDescription()==null,getServiceDescription(),false,getApplicationName());
                        serviceDescriptionDialog.setLocationRelativeTo(getContentPane());
                        serviceDescriptionDialog.open();
                        if (serviceDescriptionDialog.isServiceCreated()) {
                          setServiceDescription(serviceDescriptionDialog.getServiceDescription());
                        }
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
        }
            });
            execPath.add(new JLabel("   "));
            execPath.add(btnIOParameters);
           
            setupLayoutForBrowse(execPath,txtExecPath.getSwingComponent());

            txtAppName = new XBayaTextField();
            txtAppName.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent arg0) {
                    setApplicationName(txtAppName.getText());
                }
            });
            txtAppName.setColumns(10);
            XBayaLabel lblApplicationName = new XBayaLabel("Application name",txtAppName);
            JLabel lblExecutablePath = new JLabel("Executable path");
          JPanel tmpDirPath=new JPanel();

            txtTempDir = new XBayaTextField();
            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setTempDir(txtTempDir.getText());
                }
            });
View Full Code Here

            }
        }
        {
          JPanel execPath=new JPanel();
            txtExecPath = new XBayaTextField();
            txtExecPath.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setExecutablePath(txtExecPath.getText());
                }
            });
            txtExecPath.getTextField().addFocusListener(new FocusAdapter() {
              @Override
              public void focusLost(FocusEvent e) {
                super.focusLost(e);
                updateTempDirWithExecPath(txtExecPath.getText());
              }
      });
            txtExecPath.setColumns(10);
            btnExecBrowse=new JButton(MenuIcons.OPEN_ICON);
            btnExecBrowse.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent arg0) {
          JFileChooser c = new JFileChooser();
          int rVal = c.showOpenDialog(null);
          if (rVal == JFileChooser.APPROVE_OPTION) {
            txtExecPath.setText(c.getSelectedFile().toString());
            setExecutablePath(txtExecPath.getText());
          }
        }
            });
            execPath.add(txtExecPath.getSwingComponent());
            execPath.add(btnExecBrowse);
           
            setupLayoutForBrowse(execPath,txtExecPath.getSwingComponent());

            JLabel lblExecutablePath = new JLabel("Executable path");
          JPanel tmpDirPath=new JPanel();

            txtTempDir = new XBayaTextField();
            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setTempDir(txtTempDir.getText());
                }
            });
View Full Code Here

            JScrollPane scrollPane = new JScrollPane();
            this.add(scrollPane, BorderLayout.CENTER);
            {
                tree = new JTree(AiravataTreeNodeFactory.getTreeNode(getJCRRegistry() == null ? "No registry specified"
                         : getEngine(), null));
                tree.addKeyListener(new KeyAdapter() {
                    @Override
                    public void keyPressed(KeyEvent e) {
                        if (e.getKeyCode() == KeyEvent.VK_F5) {
                            triggerNodeAction(RefreshAction.ID);
                        }
View Full Code Here

                                                  50 );
            tf.setFont( new Font( "monospaced",
                                  Font.PLAIN,
                                  12 ) );

            tf.addKeyListener( new KeyAdapter() {
                public void keyPressed(KeyEvent e)
                {
                    if ( e.getKeyCode() == KeyEvent.VK_ENTER ) {
                        okButt.doClick();
                        return;
View Full Code Here

TOP

Related Classes of java.awt.event.KeyAdapter

Copyright © 2018 www.massapicom. 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.