Java JTextComponent isNonWhitespaceBetween(JTextComponent editor, int iStart, int iEnd)

Here you can find the source of isNonWhitespaceBetween(JTextComponent editor, int iStart, int iEnd)

Description

is Non Whitespace Between

License

Apache License

Declaration

public static boolean isNonWhitespaceBetween(JTextComponent editor, int iStart, int iEnd) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.text.BadLocationException;

import javax.swing.text.JTextComponent;

public class Main {
    public static boolean isNonWhitespaceBetween(JTextComponent editor, int iStart, int iEnd) {
        if (iStart > iEnd) {
            int iTemp = iEnd;
            iEnd = iStart;/*from   w ww .j  a va  2 s. c o m*/
            iStart = iTemp;
        }

        try {
            String strText = editor.getText(iStart, iEnd - iStart);
            return strText.trim().length() > 0;
        } catch (BadLocationException e) {
            // ignore
        }
        return false;
    }
}

Related

  1. installUi(JTextComponent txt)
  2. installUndoManager(JTextComponent textComponent)
  3. isCompletelyVisible(final JTextComponent scrollableComponent, final int pos, final Rectangle visibleRect)
  4. isEmpty(JTextComponent component)
  5. isJavaContext(final JTextComponent component, final int offset, final boolean allowInStrings)
  6. loadFileToPane(String fname, JTextComponent pane)
  7. loadTextToPane(String text, JTextComponent pane, boolean append)
  8. makeVisible(JTextComponent textPane, int start, int end)
  9. maxLength(JTextComponent textComponent, int length)