/*
 * @(#)RobustJEditorPane.java
 *
 * Summary: Robust version af JEditorPane that does not complain if roque HTML rendered generates SecurityExceptions.
 *
 * Copyright: (c) 2009 Roedy Green, Canadian Mind Products, http://mindprod.com
 *
 * Licence: This software may be copied and used freely for any purpose but military.
 *          http://mindprod.com/contact/nonmil.html
 *
 * Requires: JDK 1.5+
 *
 * Created with: IntelliJ IDEA IDE.
 *
 * Version History:
 *  1.0 2009-03-15
 */
package com.mindprod.submitter;

import javax.swing.JEditorPane;
import java.awt.Graphics;

/**
 * Robust version af JEditorPane that does not complain if roque HTML rendered generates SecurityExceptions.
 *
 * @author Roedy Green, Canadian Mind Products
 * @version 1.0 2009-03-15
 * @since 2009-03-15
 */
public class RobustJEditorPane extends JEditorPane
    {
    // -------------------------- OTHER METHODS --------------------------

    @Override
    protected void paintComponent( final Graphics g )
        {
        try
            {
            super.paintComponent( g );
            }
        catch ( SecurityException e )
            {
            // just ignore errors trying to render rogue HTML
            }
        }

    @Override
    protected void printComponent( final Graphics g )
        {
        try
            {
            super.printComponent( g );
            }
        catch ( SecurityException e )
            {
            // just ignore errors trying to render rogue HTML
            }
        }
    }