-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandPanel.java
More file actions
56 lines (44 loc) · 1.36 KB
/
CommandPanel.java
File metadata and controls
56 lines (44 loc) · 1.36 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
45
46
47
48
49
50
51
52
53
54
55
56
/*Name: Robert Hollinger
* Course: CNT 4714-Spring 2021
* Assignment Title: Project 3 - Two-Tier Client-Server Application Development With MySQL and JDBC
* Date: March 21st, 2021
*/
package sqlClientApp;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
public class CommandPanel extends JPanel{
/**
*
*/
private static final long serialVersionUID = 1375561563421026834L;
private JTextArea command;
public CommandPanel() {
setUpCommandPanel();
}
public String getCommandText() {
return this.command.getText();
}
public void clearCommandText() {
this.command.setText("");
}
private void setUpCommandPanel() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
//Setup command text area
this.command = new JTextArea(5, 20);
this.command.setMaximumSize(new Dimension(300, 200));
this.command.setAlignmentX(Component.CENTER_ALIGNMENT);
this.command.setLineWrap(true);
this.command.setWrapStyleWord(true);
//Setup title label
JLabel title = new JLabel("Enter an SQL Command");
title.setMaximumSize(new Dimension(200, 50));
title.setAlignmentX(Component.CENTER_ALIGNMENT);
//Add components to object
this.add(title);
this.add(command);
}
}