Examples of requestFocus()


Examples of javax.swing.JList.requestFocus()

            });
            w.add(new JScrollPane(jList), BorderLayout.CENTER);
            w.setPreferredSize(new Dimension(200, 200));
            Rectangle position = editorTextArea.modelToView(caretPosition);
            w.show(editorTextArea, position.x + position.width, position.y + position.height);
            jList.requestFocus();
        } catch (BadLocationException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of javax.swing.JPanel.requestFocus()

        jcb_body_type.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                JPanel jp = getPanelFromSelection();
                jsp.setViewportView(jp);
                jp.requestFocus();
            }
        });
    }

    @Override
View Full Code Here

Examples of javax.swing.JPasswordField.requestFocus()

    String retVal = null;
    JPasswordField passwordField = new JPasswordField();
    Object[] message = new Object[] {
        GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),
            "Please provide the password to open the encrypted document"), filename, passwordField };
    passwordField.requestFocus();

    if (JOptionPane.showOptionDialog(comp, message, GettextResource.gettext(Configuration.getInstance()
        .getI18nResourceBundle(), "Password request"), JOptionPane.OK_CANCEL_OPTION,
        JOptionPane.QUESTION_MESSAGE, null, null, null) == 0) {
      retVal = String.valueOf(passwordField.getPassword());
View Full Code Here

Examples of javax.swing.JRootPane.requestFocus()

      inputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0 ), "lost" );
      actionMap.put( "lost", new AbstractAction() {
        public void actionPerformed( ActionEvent e )
        {
          final JRootPane rp = SwingUtilities.getRootPane( IOTextField.this );
          if( rp != null ) rp.requestFocus();
        }
      });
      for( int i = 0; i < USERPATHS_NUM; i++ ) {
        s = "sudir" + i;
        inputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_NUMPAD1 + i, myMeta + InputEvent.ALT_MASK ), s );
View Full Code Here

Examples of javax.swing.JSplitPane.requestFocus()

    private static Action newStartResizeAction() {
        return new AbstractAction() {
            public void actionPerformed(final ActionEvent e) {
                JSplitPane splitPane = (JSplitPane)e.getSource();
                splitPane.requestFocus();
                ((BasicSplitPaneUI)splitPane.getUI()).getDivider().repaint();
            }
        };
    }
View Full Code Here

Examples of javax.swing.JTable.requestFocus()

        }
      );
 
      //make sure that 1 station is selected from the beginning.
      //default: select the first row
      stationTable.requestFocus();
      stationTable.setRowSelectionInterval(0, 0);
      //activate the selected station
      String stationName = (String) stationDtm_.getValueAt(0, 0);
      CardLayout cl = (CardLayout)(dataPanel_.getLayout());
      cl.show(dataPanel_, stationName);
View Full Code Here

Examples of javax.swing.JTextArea.requestFocus()

    tabbedPane.addTab("Error " + errorCount, panel);
    tabbedPane.setSelectedComponent(panel);
    pack();

    setVisible(true);
    textArea.requestFocus();
  }

}
View Full Code Here

Examples of javax.swing.JTextField.requestFocus()

        JOptionPane.OK_CANCEL_OPTION);
    pane.setInitialValue(field);
    JDialog dlog = pane.createDialog(frame, Strings.get("circuitNameDialogTitle"));
    dlog.addWindowFocusListener(new WindowFocusListener() {
      public void windowGainedFocus(WindowEvent arg0) {
        field.requestFocus();
      }

      public void windowLostFocus(WindowEvent arg0) { }
    });
   
View Full Code Here

Examples of javax.swing.JTextPane.requestFocus()

  select(true);

    JTextPane textPane = (JTextPane)getComponent();
    textPane.setEditable(true);
    textPane.getCaret().setVisible(true);
    textPane.requestFocus();
    origHeight = textPane.getBounds().height;

    sectionWidget.designer.setIgnoreKeys(true);

    textPane.removeMouseListener(this);
View Full Code Here

Examples of javax.swing.JToggleButton.requestFocus()

        updateCalendar();
       
        // give focus to selected date button
        int day = selectedDate.get(Calendar.DAY_OF_MONTH);
        JToggleButton button = dayButtons.get(day - 1);
        button.requestFocus();
    }
   
    /**
     * Gets the month displayed
     * @return the month currently displayed in the window
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.