Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.util.*;

import javax.swing.text.*;
import javax.swing.text.Highlighter.Highlight;

public class Main {
    public static void removeHightlights(final Collection<Highlighter.HighlightPainter> sample,
            Highlighter highlighter) {
        for (Highlight highlight : highlighter.getHighlights()) {
            if (sample.contains(highlight.getPainter())) {
                highlighter.removeHighlight(highlight);
            }
        }

    }

    public static void removeHightlights(final Highlighter.HighlightPainter sample, Highlighter highlighter) {
        for (Highlight highlight : highlighter.getHighlights()) {
            if (sample == highlight.getPainter()) {
                highlighter.removeHighlight(highlight);
            }
        }

    }
}