Java 8 InputMethodEvent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InputMethodEvent class.

This code example shows how to use the following methods:getText
         Debug.info("[TextPropertyEditor] User pressed ENTER");
          
         if (getTargetComponent() instanceof SikuliGuideText) 
            ((SikuliGuideText) getTargetComponent()).setText(textField.getText());
         else if (getTargetComponent() instanceof SikuliGuideFlag) 
            ((SikuliGuideFlag) getTargetComponent()).setText(textField.getText());
          
         setVisible(false);      
                   
      }else if (k.getKeyCode() == KeyEvent.VK_ESCAPE){
          
         Debug.info("[TextPropertyEditor] User pressed ESCAPE");
          
         setVisible(false); 
          
      } 
   } 
    
 
    
7
CodeRank
This code example shows how to use the following methods:addCaretListener, getText, setText
 
  /** the label for the URL. */ 
  protected JLabel m_LabelURL = new JLabel("URL ");
 
  /** the textfield for the URL. */ 
  protected JTextField m_TextURL = new JTextField(40);
 
  /** the button for the DB-Dialog. */ 
  protected JButton m_ButtonDatabase = new JButton("User...");
 
  /** the button for connecting to the database. */ 
  protected JButton m_ButtonConnect = new JButton("Connect");
 
  /** the button for the history. */ 
  protected JButton m_ButtonHistory = new JButton("History...");
 
  /** the connection listeners. */ 
  protected HashSet m_ConnectionListeners;
 
  /** the history listeners. */ 

7
CodeRank
This code example shows how to use the following methods:setLineWrap, setWrapStyleWord, setCaretPosition, setEditable
     * @return a panel. 
     */ 
    private JPanel createLicencePanel() {
 
        final JPanel licencePanel = new JPanel(new BorderLayout());
        final JTextArea area = new JTextArea(this.licence);
        area.setLineWrap(true);
        area.setWrapStyleWord(true);
        area.setCaretPosition(0);
        area.setEditable(false);
        licencePanel.add(new JScrollPane(area));
        return licencePanel;
 
    } 
 
 
} 
7
CodeRank
This code example shows how to use the following methods:setLineWrap, setWrapStyleWord, setEditable
     * @see org.apache.jmeter.visualizers.request.RequestView#init() 
     */ 
    @Override 
    public void init() { 
        paneRaw = new JPanel(new BorderLayout(0, 5));
        sampleDataField = new JTextArea();
        sampleDataField.setEditable(false);
        sampleDataField.setLineWrap(true);
        sampleDataField.setWrapStyleWord(true);
 
        paneRaw.add(GuiUtils.makeScrollPane(sampleDataField));
 
    } 
 
    /* (non-Javadoc) 
     * @see org.apache.jmeter.visualizers.request.RequestView#clearData() 
     */ 
    @Override 
    public void clearData() { 
        sampleDataField.setText(""); //$NON-NLS-1$
7
CodeRank
This code example shows how to use the following methods:getText
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(startButton, c);
    } 
     
    private void start() { 
        workingMemory.startProcess(processIdTextField.getText());
        workingMemory.fireAllRules();
    } 
     
} 
7
CodeRank
This code example shows how to use the following methods:getDocument, getSelectionEnd, getSelectionStart
    public void caretUpdate(CaretEvent evt) {
		updateLabel(evt.getDot());
	} 
 
	protected void updateLabel(int pos) {
        if (text.getDocument() instanceof SyntaxDocument) {
            try { 
                if (text.getSelectionStart() == text.getSelectionEnd()) {
                    String loc = String.format(noSelectionFormat,
                            ActionUtils.getLineNumber(text, pos) + 1,
                            ActionUtils.getColumnNumber(text, pos) + 1,
                            pos);
                    label.setText(loc);
                } else { 
                    int start = text.getSelectionStart();
                    int end = text.getSelectionEnd();
                    String loc = String.format(selectionFormat,
                            ActionUtils.getLineNumber(text, start) + 1,
                            ActionUtils.getColumnNumber(text, start) + 1,
                            ActionUtils.getLineNumber(text, end) + 1,

6
CodeRank
This code example shows how to use the following methods:getFont, setFont, addCaretListener, getText
    SpinnerNumberModel  model;
     
    setLayout(new BorderLayout());
     
    // textarea 
    m_TextQuery = new JTextArea();
    m_TextQuery.addCaretListener(this);
    m_TextQuery.setFont(
        new Font("Monospaced", Font.PLAIN, m_TextQuery.getFont().getSize()));
    add(new JScrollPane(m_TextQuery), BorderLayout.CENTER);
 
    // buttons 
    panel = new JPanel(new BorderLayout());
    add(panel, BorderLayout.EAST);
    m_ButtonExecute.setMnemonic('E');
    m_ButtonExecute.addActionListener(new ActionListener() {
	public void actionPerformed(ActionEvent e) {
	  execute(); 
	} 
      }); 

7
CodeRank
This code example shows how to use the following methods:getDocument, getSelectionEnd, getSelectionStart

6
CodeRank
This code example shows how to use the following methods:setColumns, setDocument, setEditable
    public PasswordField(Element e, XhtmlForm form, LayoutContext context, BlockBox box) {
        super(e, form, context, box);
    } 
 
    public JComponent create() {
        JPasswordField password = new JPasswordField();
 
        if (hasAttribute("size")) { 
            int size = GeneralUtil.parseIntRelaxed(getAttribute("size"));
             
            // Size of 0 doesn't make any sense, so use default value 
            if (size == 0) {
                password.setColumns(15);
            } else { 
                password.setColumns(size);
            } 
        } else { 
            password.setColumns(15);
        } 
 

7
CodeRank
This code example shows how to use the following methods:setBackground, setLineWrap, setWrapStyleWord, setEditable
     * @param entity The evolved entity to render. 
     * @return A text area containing the string representation of the entity. 
     */ 
    public JComponent render(Object entity)
    { 
        JTextArea text = new JTextArea(entity.toString());
        text.setEditable(false);
        text.setBackground(null);
        text.setLineWrap(true);
        text.setWrapStyleWord(true);
        return text;
    } 
} 
7
CodeRank
See Code Examples for Java 8 InputMethodEvent Methods: