-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathProgramPanel.java
More file actions
49 lines (40 loc) · 1.54 KB
/
ProgramPanel.java
File metadata and controls
49 lines (40 loc) · 1.54 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
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
@SuppressWarnings("serial")
public class ProgramPanel extends JPanel{
private GuiControl guiControl;
private GridBagLayout gridBagLayoutMain;
private BoxLayout boxLayout;
private JTextField textFieldProgram = new JTextField("sacd_extract executable");
private JButton buttonBrowse = new JButton("Browse...");
private JButton buttonTest = new JButton("Test");
public void setControl(GuiControl c){
guiControl = c;
}
public ProgramPanel(){
setupGui();
}
public String getTextTextFieldProgram(){
return textFieldProgram.getText();
}
public void setTextTextFieldProgram(String s){
textFieldProgram.setText(s);
}
private void setupGui(){
boxLayout = new BoxLayout(this, BoxLayout.LINE_AXIS);
textFieldProgram.setMaximumSize(new Dimension(Integer.MAX_VALUE, textFieldProgram.getPreferredSize().height));
buttonTest.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
guiControl.buttonProgramTest();}});
buttonBrowse.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
guiControl.buttonBrowseProgram();}});
this.setBorder(BorderFactory.createTitledBorder("Program"));
this.setLayout(boxLayout);
this.add(textFieldProgram);
this.add(buttonBrowse);
this.add(buttonTest);
}
}