@Override
    public void setContent(InputStream data) throws IOException {
        try {
            ImageIcon image =
                    new ImageIcon(JAI
                            .create("stream",
                                    new MemoryCacheSeekableStream(data))
                            .getAsBufferedImage());
            if (m_pane == null) {
                m_label = new JLabel(image);
                m_pane = new JScrollPane(m_label);
            } else {
                m_label.setIcon(image);
            }
        } catch (Exception e) {
            throw new IOException(e.getMessage());
        }
    }
@ Override public void setContent ( InputStream data ) throws IOException { try { ImageIcon image = new ImageIcon ( JAI . create ( "stream" , new MemoryCacheSeekableStream ( data ) ) . getAsBufferedImage ( ) ) ; if ( m_pane == null ) { m_label = new JLabel ( image ) ; m_pane = new JScrollPane ( m_label ) ; } else { m_label . setIcon ( image ) ; } } catch ( Exception e ) { throw new IOException ( e . getMessage ( ) ) ; } }
Re-initializes the handler given new input data. The old data can be
discarded.