1 package org.wcb.gui.forms.wizard;
2
3 import org.wcb.gui.component.JXTitlePanel;
4 import org.wcb.gui.dialog.file.FAA8710FileDialog;
5 import org.jdesktop.swingx.border.DropShadowBorder;
6
7 import javax.swing.border.Border;
8 import javax.swing.border.CompoundBorder;
9 import javax.swing.*;
10 import java.awt.*;
11 import java.awt.event.ActionListener;
12 import java.awt.event.ActionEvent;
13 import java.io.File;
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 public class Step6of8710Wizard extends JXTitlePanel implements ActionListener {
43
44 public Step6of8710Wizard() {
45 super("Step 6 of 6 - Save to File", new Color(0x3779ff));
46 Border shadow = new DropShadowBorder(Color.BLACK, 1, 5, .3f, 15, true, true, true, true);
47 setBorder(new CompoundBorder(shadow, getBorder()));
48 initComponents();
49 }
50
51
52
53
54
55
56 private void initComponents() {
57 GridBagConstraints gridBagConstraints;
58
59 fileName = new JTextField(System.getProperty("user.home") + File.separator + "8710-temp.pdf");
60 fileLocationButton = new JButton("..");
61 fileLocationButton.addActionListener(this);
62
63 setLayout(new GridBagLayout());
64
65 gridBagConstraints = new GridBagConstraints();
66 gridBagConstraints.anchor = GridBagConstraints.WEST;
67 add(new JLabel("File Name"), gridBagConstraints);
68
69 gridBagConstraints = new GridBagConstraints();
70 gridBagConstraints.anchor = GridBagConstraints.WEST;
71 add(fileName, gridBagConstraints);
72
73 gridBagConstraints = new GridBagConstraints();
74 gridBagConstraints.anchor = GridBagConstraints.WEST;
75 add(fileLocationButton, gridBagConstraints);
76 }
77
78 public String getFilePathName() {
79 return fileName.getText();
80 }
81
82 public void actionPerformed(ActionEvent evt) {
83 FAA8710FileDialog savePdfDialog = new FAA8710FileDialog();
84 String pdfPath = savePdfDialog.getFilePath();
85 if (pdfPath !=null && !pdfPath.equals("")) {
86 fileName.setText(pdfPath);
87 }
88 }
89
90
91
92 private JTextField fileName;
93 private JButton fileLocationButton;
94
95
96
97 }