Examples of DocumentListener


Examples of javax.swing.event.DocumentListener

  {
    JPanel pnl = new JPanel(new GridBagLayout());
    pnl.setBorder(BorderFactory.createTitledBorder(i18n.UPDATE_SITE_BORDER_LABEL));

    ItemListener urlUpdateItemListener = new UrlItemListener();
    DocumentListener urlDocumentListener = new UrlDocumentListener();
    final GridBagConstraints gbc = new GridBagConstraints();

    setSeparatorConstraints(gbc, 0);
    gbc.gridwidth = 1;
    gbc.weightx = 0;
View Full Code Here

Examples of javax.swing.event.DocumentListener

        doc.setDocumentFilter(new GroovyFilter(doc));
        textEditor.setDocument(doc);

        // add a document listener, to hint whether the line number gutter has to be repainted
        // when the number of lines changes
        doc.addDocumentListener(new DocumentListener() {
            public void insertUpdate(DocumentEvent documentEvent) {
                documentChangedSinceLastRepaint = true;
            }

            public void removeUpdate(DocumentEvent documentEvent) {
View Full Code Here

Examples of javax.swing.event.DocumentListener

                //JOptionPane.showMessageDialog(null, "Sorry, the icon can unfortunately not be changed in this version of JabRef");
            }
        });

        if (Globals.ON_WIN) {
            application.getDocument().addDocumentListener(new DocumentListener() {
                private void handle(DocumentEvent e) {
                    if (application.getText().length() == 0) {
                        useDefault.setSelected(true);
                    } else {
                        other.setSelected(true);
View Full Code Here

Examples of javax.swing.event.DocumentListener

        ActionMap am = builder.getPanel().getActionMap();
        InputMap im = builder.getPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        im.put(Globals.prefs.getKey("Close dialog"), "close");
        am.put("close", cancelAction);

        link.getDocument().addDocumentListener(new DocumentListener() {
            public void insertUpdate(DocumentEvent documentEvent) {
                checkExtension();
            }
            public void removeUpdate(DocumentEvent documentEvent) {
            }
View Full Code Here

Examples of javax.swing.event.DocumentListener

                ownIdentitiesComboBox.addItem(element);
            }

            final TextComboBoxEditor editor = new TextComboBoxEditor();

            editor.getDocument().addDocumentListener(new DocumentListener() {
                public void changedUpdate(final DocumentEvent e) {
                    updateHeaderArea2();
                }
                public void insertUpdate(final DocumentEvent e) {
                    updateHeaderArea2();
View Full Code Here

Examples of javax.swing.event.DocumentListener

        return result;
    }

    private Component createStringComponent(final StringOption option) {
        final JTextField result = new JTextField(option.getValue());
        result.getDocument().addDocumentListener(new DocumentListener() {
            public void insertUpdate(DocumentEvent e) {
                option.setValue(result.getText());
            }

            public void removeUpdate(DocumentEvent e) {
View Full Code Here

Examples of javax.swing.event.DocumentListener

            UIUtil.jGridBagAdd(sizePanel, new JLabel("Size:"), gBC3, GridBagConstraints.REMAINDER);

            UIUtil.jGridBagAdd(sizePanel, fontSize = new JFormattedTextField(new Integer(4)), gBC3, GridBagConstraints.REMAINDER);

            fontSize.getDocument().addDocumentListener(new DocumentListener() {



                public void insertUpdate(DocumentEvent e) {

                    if (!sizeIsAdjusting)

                        changeFontBasedOnState();

                }



                public void removeUpdate(DocumentEvent e) {

                    if (!sizeIsAdjusting)

                        changeFontBasedOnState();

                }



                public void changedUpdate(DocumentEvent e) {

                    if (!sizeIsAdjusting)

                        changeFontBasedOnState();

                }

            });

            gBC3.weighty = 1.0;

            UIUtil.jGridBagAdd(sizePanel, new JScrollPane(fontSizeList), gBC3, GridBagConstraints.REMAINDER);

        }



        // Create the panel where selection of the font name takes place

        JPanel namePanel = new JPanel(new GridBagLayout());

        namePanel.setBorder(BorderFactory.createTitledBorder("Font name"));



        GridBagConstraints gBC2 = new GridBagConstraints();

        gBC2.fill = GridBagConstraints.BOTH;

        gBC2.anchor = GridBagConstraints.WEST;

        gBC2.weightx = 1.0;

        gBC2.weighty = 0.0;

        gBC2.insets = new Insets(2, 2, 2, 2);

        UIUtil.jGridBagAdd(namePanel, new JLabel("Name:"), gBC2, GridBagConstraints.REMAINDER);

        UIUtil.jGridBagAdd(namePanel, fontName = new JTextField(10), gBC2, GridBagConstraints.REMAINDER);

        fontName.addFocusListener(new FocusListener() {

            public void focusGained(FocusEvent e) {

                fontName.selectAll();

            }



            public void focusLost(FocusEvent e) {

            }

        });

        gBC2.weighty = 1.0;

        UIUtil.jGridBagAdd(namePanel, new JScrollPane(fontNameList), gBC2, GridBagConstraints.REMAINDER);



        // Create the preview label

        preview = new JLabel("Some sample text") {

            public Dimension getMinimumSize() {

                return new Dimension(super.getMinimumSize().width, 64);

            }



            public Dimension getPreferredSize() {

                return new Dimension(320, 64);

            }

        };

        preview.setBackground(Color.white);

        preview.setForeground(Color.black);

        preview.setOpaque(true);

        preview.setHorizontalAlignment(SwingConstants.CENTER);

        preview.setBorder(BorderFactory.createLineBorder(Color.black));



        // Create the preview panel

        JPanel previewPanel = new JPanel(new BorderLayout());

        previewPanel.setBorder(BorderFactory.createTitledBorder("Preview"));

        previewPanel.add(preview, BorderLayout.CENTER);



        // Create the right panel

        JPanel rightPanel = new JPanel(new BorderLayout());

        if (stylePanel != null) {

            rightPanel.add(stylePanel, BorderLayout.NORTH);

        }

        if (sizePanel != null) {

            rightPanel.add(sizePanel, BorderLayout.CENTER);

        }



        // Listen for changes in the font name and select the closest font in

        // the list

        fontName.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {

                if (!adjusting) {
View Full Code Here

Examples of javax.swing.event.DocumentListener

    private JTextField getTFlookup() {
        if( TFlookup == null ) {
            TFlookup = new JTextField(10);
            // force a max size, needed for BoxLayout
            TFlookup.setMaximumSize(TFlookup.getPreferredSize());
            TFlookup.getDocument().addDocumentListener(new DocumentListener() {
                    public void changedUpdate(final DocumentEvent e) {
                        lookupContentChanged();
                    }
                    public void insertUpdate(final DocumentEvent e) {
                        lookupContentChanged();
View Full Code Here

Examples of javax.swing.event.DocumentListener

    private JTextField getTFfilter() {
        if( TFfilter == null ) {
            TFfilter = new JTextField(10);
            TFfilter.setMaximumSize(TFfilter.getPreferredSize());

            TFfilter.getDocument().addDocumentListener(new DocumentListener() {
                    public void changedUpdate(final DocumentEvent e) {
                        filterContentChanged();
                    }
                    public void insertUpdate(final DocumentEvent e) {
                        filterContentChanged();
View Full Code Here

Examples of javax.swing.event.DocumentListener

    /**
     *  Constructor for the ScalePanel object
     */
    public ScalePanel() {
      DocumentListener documentListener = new DocumentListener() {
        public void changedUpdate(DocumentEvent e) {
           setValues();
          karyoDrawer.notifyObservers();
        }
        public void insertUpdate(DocumentEvent e) {
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.