-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTriConsole.java
More file actions
44 lines (33 loc) · 1.26 KB
/
TriConsole.java
File metadata and controls
44 lines (33 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import java.awt.*;
import javax.swing.*;
import java.io.*;
http://docs.oracle.com/javase/tutorial/uiswing/layout/spring.html
http://docs.oracle.com/javase/tutorial/uiswing/components/text.html
http://docs.oracle.com/javafx/2/ui_controls/text-field.htm
public class TriConsole extends JFrame {
private JTextPane output;
private JTextArea input;
private JTextArea command;
public TriConsole() {
SpringLayout layout = new SpringLayout();
getContentPane().setLayout(layout);
JLabel ouputLabel = new JLabel("Ouput:");
getContentPane().add(ouputLabel);
output = new JTextPane();
output.setEditable(false);
JScrollPane outputScrollPane = new JScrollPane(output);
getContentPane().add(outputScrollPane);
input = new JTextArea(2, 80);
command = new JTextArea(2, 80);
getContentPane().add(new JLabel("Program Input:"));
getContentPane().add(input);
getContentPane().add(new JLabel("Command:"));
getContentPane().add(command);
layout.putContraints(SpringLayout.WEST, outputLabel, 5, SpringLayout.SOUTH, output);
pack();
setVisible(true);
}
public static void main(String[] args) {
new TriConsole();
}
}