1 | package de.uka.ipd.sdq.pcmsolver.transformations.pcm2lqn; |
2 | |
3 | import java.awt.Font; |
4 | |
5 | import javax.swing.JFrame; |
6 | import javax.swing.JScrollPane; |
7 | import javax.swing.JTextArea; |
8 | |
9 | public class ResultWindow { |
10 | |
11 | JFrame frame; |
12 | |
13 | public ResultWindow(String text) { |
14 | JTextArea textArea = new JTextArea(5, 20); |
15 | textArea.setEditable(false); |
16 | textArea.setText(text); |
17 | |
18 | Font font = new Font("Monospaced", Font.PLAIN, 12); |
19 | textArea.setFont(font); |
20 | |
21 | JScrollPane scrollPane = new JScrollPane(textArea, |
22 | JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, |
23 | JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); |
24 | |
25 | frame = new JFrame("LQN Output"); |
26 | frame.getContentPane().add(scrollPane); |
27 | frame.setExtendedState(frame.getExtendedState() | frame.MAXIMIZED_BOTH); |
28 | |
29 | |
30 | // frame.setSize(800, 600); |
31 | // frame.setLocation( |
32 | // (Toolkit.getDefaultToolkit().getScreenSize().width - frame |
33 | // .getSize().width) / 2, (Toolkit.getDefaultToolkit() |
34 | // .getScreenSize().height - frame.getSize().height) / 2); |
35 | } |
36 | |
37 | public void open() { |
38 | frame.setVisible(true); |
39 | } |
40 | } |