final JComponent panel = new JPanel(new BorderLayout());
panel.setBorder(new EmptyBorder(10, 10, 10, 10));
final HTMLEditorKit htmlEditorKit = new HTMLEditorKit();
htmlEditorKit.setStyleSheet(GuiResources.EDITORPANE_STYLESHEET);
final JEditorPane jEditorPane = new JEditorPane() {
@Override
protected void paintComponent(final Graphics g) {
super.paintComponent(g);
final Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
}
};
jEditorPane.setPreferredSize(new Dimension(550, 650));
jEditorPane.setEditable(false);
jEditorPane.setContentType("text/html");
jEditorPane.setEditorKit(htmlEditorKit);
jEditorPane.setText(html.toString());
panel.add(ScrollPaneFacade.createScrollPane(jEditorPane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));
panel.setBorder(BorderFactory.createTitledBorder("FindBugs analysis run configuration"));
dialogBuilder.setCenterPanel(panel);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
jEditorPane.scrollRectToVisible(new Rectangle(0, 0));
}
});
return dialogBuilder;
}