- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConvertHTMLDialog.java
More file actions
Latest commit
49 lines (40 loc) · 1.38 KB
/
Copy pathConvertHTMLDialog.java
File metadata and controls
49 lines (40 loc) · 1.38 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
importjavax.swing.*;
importjava.awt.*; // FlowLayout
// not tested
publicclassConvertHTMLDialogextendsJDialog {
// widgets
JLabelfileLabel;
JComboBoxfileComboBox;
JButtonokButton;
FlowLayoutmainLayout;
ConvertHTMLDialog () {
super(); // invoke parent constructor
// widgets
this.fileLabel = newJLabel();
this.fileLabel.setText("Select HTML file to convert");
String[] cbItems = ConvertHTMLDialog.getCbItems();
this.fileComboBox = newJComboBox(cbItems);
this.okButton = newJButton();
this.okButton.setText("OK");
// layout
this.mainLayout = newFlowLayout();
this.setLayout(this.mainLayout);
this.add(this.fileLabel);
this.add(this.fileComboBox);
this.add(this.okButton);
// event listeners
this.okButton.addActionListener((event) -> this.onOKButtonPressed());
// frame
ImageIconlogo = newImageIcon("images/icon.png");
this.setIconImage(logo.getImage());
this.setTitle("Select HTML Bracket");
this.setSize(400, 500);
}
voidonOKButtonPressed () {
// todo
}
staticString[] getCbItems() {
String[] cbItems = {"french_open.html", "rogers.html", "atp_finals.html"}; // todo: get proper items
returncbItems;
}
}