editTP.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent keyEvent) {
jsp.setPreferredSize(new Dimension(fWidth, fHeight)); jtp.addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent e) {
/** * If the GM enforces typing notification and no listener is present (because the client had notification off), a * new listener is added to the command text area */ private void maybeAddTypingListener() { if (commandTextArea.getListeners(ChatTypingListener.class).length == 0) { commandTextArea.addKeyListener(new ChatTypingListener()); } } }
public void bindToPreferences(JTextPane component, String key, String defaultValue) { component.setText(getString(key, defaultValue)); setString(key, component.getText()); JTextPaneBindingAction action = new JTextPaneBindingAction(component, key); bindings.put(key, action); component.addKeyListener(action); }
public void pipeInput() { EventQueue.invokeLater( () -> { try { _oldIn = System.in; PipedInputStream sysIn = new PipedInputStream(); Process process = _processRunner.getProcess(); if( process == null ) { // Assume we are in-process _inWriter = new OutputStreamWriter( new PipedOutputStream( sysIn ) ); System.setIn( sysIn ); } else { _inWriter = new OutputStreamWriter( process.getOutputStream() ); } } catch( IOException e ) { throw new RuntimeException( e ); } JTextPane outputPanel = _consolePanel.getOutputPanel(); outputPanel.setEditable( true ); _sysInListener = new SysInListener(); outputPanel.addKeyListener( _sysInListener ); } ); }
this.textPane.addKeyListener(new KeyListener() {
public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { if (ours != null) commandTextArea.removeKeyListener(ours); ours = null; // Go ahead and turn off the chat panel right away. MapTool.getFrame().getChatTypingPanel().setVisible(false); } else if (e.getStateChange() == ItemEvent.DESELECTED) { if (ours == null) ours = new ChatTypingListener(); commandTextArea.addKeyListener(ours); } } });
this.textPane.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) {
public CommandWindow(Module m) { this.module = m; textField = new JTextPane() { public boolean getScrollableTracksViewportWidth() { return false; } public void setSize(Dimension d) { if (d.width < getParent().getSize().width) { d.width = getParent().getSize().width; } super.setSize(d); } }; doc = textField.getDocument(); textField.setFont(new Font("Monospaced", Font.PLAIN, 13)); textField.addKeyListener(this); appendText(">> "); endPos = doc.getLength(); setBorder(BorderFactory.createTitledBorder("Command Window")); setLayout(new BorderLayout()); JScrollPane scrollPane = new JScrollPane(textField); add(scrollPane, BorderLayout.CENTER); }
textPane.addKeyListener(new SetChangedStateListener());
public class AddWordWindow extends JFrame{ public AddWordWindow(){ getContentPane().setLayout(null); JTextPane wordText = new JTextPane(); wordText.setBounds(10, 21, 82, 20); getContentPane().add(wordText); JTextArea descriptionText = new JTextArea(); descriptionText.setBounds(10, 66, 143, 57); getContentPane().add(descriptionText); descriptionText.setEnabled(false); wordText.addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent e) { if(wordText.getText().length()>2){ descriptionText.setEnabled(true); } } }); }
text.setFont( font ); text.setMargin( new Insets(7,5,7,5) ); text.addKeyListener(this); setViewportView(text);
commandTextArea.setPreferredSize(new Dimension(50, 40)); // XXX should be resizable commandTextArea.setFont(new Font("sans-serif", 0, AppPreferences.getFontSize())); commandTextArea.addKeyListener(new ChatTypingListener()); SwingUtil.useAntiAliasing(commandTextArea);
public Terminal() { TextColor.initGui(); JTerm.IS_WIN = false; JTerm.IS_UNIX = true; setContentPane(contentPane); // call onCancel() when cross is clicked setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { onCancel(); } }); // call onCancel() on ESCAPE contentPane.registerKeyboardAction(e -> onCancel(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); textPane.setBackground(new Color(28, 28, 28)); textPane.setEditable(true); textPane.addKeyListener(this); }
pane.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ESCAPE) {
txtTargetQuery.addKeyListener(new TABKeyListener()); txtSourceQuery.addKeyListener(new TABKeyListener()); tblQueryResult.setFocusable(false); txtTargetQuery.addKeyListener(new CTRLEnterKeyListener()); txtSourceQuery.addKeyListener(new CTRLEnterKeyListener()); txtMappingID.addKeyListener(new CTRLEnterKeyListener());
textArea.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent ke) {
consolePane.addKeyListener(this); consolePane.addCaretListener(this);
/** * Creates new form QueryInterfacePanel */ public QueryInterfacePanel(OBDAModel apic, QueryController qc) { this.qc = qc; this.apic = apic; initComponents(); StyleContext style = new StyleContext(); styledDocument = new DefaultStyledDocument(style); queryTextPane.setDocument(styledDocument); queryTextPane.setBackground(Color.WHITE); queryTextPane.setCaretColor(Color.BLACK); queryTextPane.addKeyListener(new CTRLEnterKeyListener()); }
editorPane.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) {