1
16package org.tp23.antinstaller.runtime.exe;
17
18import java.awt.BorderLayout;
19import java.awt.Dimension;
20import java.awt.GraphicsConfiguration;
21import java.awt.HeadlessException;
22
23import javax.swing.JEditorPane;
24import javax.swing.JFrame;
25import javax.swing.JScrollPane;
26
27
28
33public class ReleaseNotesFrame extends JFrame {
34
35 private BorderLayout borderLayout1 = new BorderLayout();
36 private JEditorPane contentsEditorPane = new JEditorPane();
37 private JScrollPane hPanelScrollPane = new JScrollPane();
38
39 public ReleaseNotesFrame(String title) throws HeadlessException {
40 super(title);
41 }
42
43 public void init(String text){
44 contentsEditorPane.setMinimumSize(new Dimension(200, 200));
45 contentsEditorPane.setPreferredSize(new Dimension(1000, Integer.MAX_VALUE));
46 contentsEditorPane.setEditable(false);
47 contentsEditorPane.setContentType("text/plain");
48 contentsEditorPane.setCaretPosition(0);
49 contentsEditorPane.setText(text);
50 this.getContentPane().setLayout(borderLayout1);
51 hPanelScrollPane.setMinimumSize(new Dimension(200, 200));
52 hPanelScrollPane.setPreferredSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
53 this.getContentPane().add(hPanelScrollPane, BorderLayout.CENTER);
54 hPanelScrollPane.getViewport().add(contentsEditorPane);
55 hPanelScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
56 this.setSize(new Dimension(500,500));
57 hPanelScrollPane.setWheelScrollingEnabled(true);
58 this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
59 this.show();
60
61 }
62
63}
64