Java JTextComponent removeAllHighlightsUsingPainter(final JTextComponent textComponent, final Highlighter.HighlightPainter painter)

Here you can find the source of removeAllHighlightsUsingPainter(final JTextComponent textComponent, final Highlighter.HighlightPainter painter)

Description

remove All Highlights Using Painter

License

Open Source License

Declaration

public static void removeAllHighlightsUsingPainter(final JTextComponent textComponent,
            final Highlighter.HighlightPainter painter) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.text.*;

public class Main {
    public static void removeAllHighlightsUsingPainter(final JTextComponent textComponent,
            final Highlighter.HighlightPainter painter) {
        Highlighter highlighter = textComponent.getHighlighter();
        for (Highlighter.Highlight highlight : highlighter.getHighlights()) {
            if (highlight.getPainter() == painter) {
                highlighter.removeHighlight(highlight);
            }/*from www . j av a2s. com*/
        }
    }
}

Related

  1. parseDouble(JTextComponent textComponent)
  2. readOnly(JTextComponent c, Component parent)
  3. refreshJTextComponent(JTextComponent textComponent)
  4. registerEvents(final JTextComponent textCmp, final String hintText)
  5. registerUpperCase(final JTextComponent textComp)
  6. removeDocumentListeners(JTextComponent component)
  7. safeGetText(JTextComponent textComponent)
  8. scrollToText(JTextComponent textComponent, int startingIndex, int endingIndex)
  9. scrollToTop(JTextComponent edit1)