Package java.awt.event

Examples of java.awt.event.TextEvent


     * @param peer the peer
     * @param com the component
     */
    protected void createTextEvent(BridgeInputContext context, BridgePeer peer, TextComponent com)
    {
        postEvent(context, new TextEvent(com, TextEvent.TEXT_VALUE_CHANGED), BridgeEventQueue.HIGH_PRIORITY);
    }
View Full Code Here


     * Test method for 'java.awt.TextComponent.processTextEvent(TextEvent)'
     */
    public void testProcessTextEvent() {
        eventProcessed = false;
        textComp.addTextListener(listener);
        textComp.processEvent(new TextEvent(textComp, TextEvent.TEXT_VALUE_CHANGED));
        assertTrue("text event processed", eventProcessed);
    }
View Full Code Here

    private static void fireTextEvent() {
        EventListener[] lstrs =
                EVENT_LISTENER_LIST.getListeners(TextListener.class);
        if (lstrs != null && lstrs.length > 0) {
            TextEvent te =
                    new TextEvent(FIND_REPLACE_DIALOG, TextEvent.TEXT_VALUE_CHANGED);
            for (int i = 0; i < lstrs.length; i++) {
                ((TextListener) lstrs[i]).textValueChanged(te);
            }
        }
    }
View Full Code Here

        public void actionPerformed(ActionEvent e) {

            if (e.getSource() == ok || e.getSource() == textField) {
                System.out.println("FileNameInput: pressed OK");
                    TextEvent event = new TextEvent(textField, TextEvent.TEXT_VALUE_CHANGED);
                    deliverEvent(event);
                    setVisible(false);
            } else
            if (e.getSource() == cancel) {
                System.out.println("FileNameInput: pressed cancel");
View Full Code Here

         * @param evt The event to deliver.
         */
        protected void deliverEvent(EventObject evt) {

            if (evt instanceof TextEvent) {
                TextEvent event = (TextEvent)evt;

                Vector l;
                synchronized (textListeners) { l = (Vector)textListeners.clone(); }

                int size = l.size();
View Full Code Here

        public void actionPerformed(ActionEvent e) {

            if (e.getSource() == ok || e.getSource() == textField) {
                System.out.println("FileNameInput: pressed OK");
                    TextEvent event = new TextEvent(textField, TextEvent.TEXT_VALUE_CHANGED);
                    deliverEvent(event);
                    setVisible(false);
            } else
            if (e.getSource() == cancel) {
                System.out.println("FileNameInput: pressed cancel");
View Full Code Here

         * @param evt The event to deliver.
         */
        protected void deliverEvent(EventObject evt) {

            if (evt instanceof TextEvent) {
                TextEvent event = (TextEvent)evt;

                Vector l;
                synchronized (textListeners) { l = (Vector)textListeners.clone(); }

                int size = l.size();
View Full Code Here

   
    private static void fireTextEvent() {
        EventListener[] lstrs =
            EVENT_LISTENER_LIST.getListeners(TextListener.class);
        if (lstrs != null && lstrs.length > 0) {
            TextEvent te =
                new TextEvent(FIND_REPLACE_DIALOG, TextEvent.TEXT_VALUE_CHANGED);
            for (int i = 0; i < lstrs.length; i++) {
                ((TextListener)lstrs[i]).textValueChanged(te);
            }
        }
    }
View Full Code Here

            // the document listener has to be disabled while
            // JTextField.setText() is called.
            xtext.getDocument().removeDocumentListener(xtext);
            xtext.setText(txt);
            if (firstChangeSkipped) {
                postEvent(new TextEvent(target, TextEvent.TEXT_VALUE_CHANGED));
            }
            xtext.getDocument().addDocumentListener(xtext);
            xtext.setCaretPosition(0);
        }
        return true;
View Full Code Here

        }

        public void insertUpdate(DocumentEvent e) {
            if (peer != null) {
                peer.postEvent(new TextEvent(peer.target,
                                             TextEvent.TEXT_VALUE_CHANGED));
            }
        }
View Full Code Here

TOP

Related Classes of java.awt.event.TextEvent

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.