mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
For adding attachments a swing JFileChooser is now displayed instead of the AWT FileDialog
This commit is contained in:
parent
8af80013bc
commit
af18b408ec
@ -273,16 +273,16 @@ public class AttachmentsList extends JScrollPane implements Serializable {
|
||||
Frame parentFrame = getTopLevelFrame(this);
|
||||
|
||||
if (null != parentFrame) {
|
||||
FileDialog file = new FileDialog (parentFrame, "Attach File", FileDialog.LOAD);
|
||||
|
||||
file.setFile ("*.*"); //all files.
|
||||
file.show(); //show the dialog. This blocks.
|
||||
JFileChooser file = new JFileChooser ();
|
||||
|
||||
file.setDialogTitle ("Attach File");
|
||||
file.showDialog(parentFrame, "Attach"); //show the dialog. This blocks.
|
||||
|
||||
//didi they select a file?
|
||||
if (null != file.getFile()) {
|
||||
if (null != file.getSelectedFile()) {
|
||||
|
||||
//assemble the full path.
|
||||
String fullPath = file.getDirectory() + file.getFile();
|
||||
String fullPath = file.getSelectedFile().getAbsolutePath();
|
||||
addAttachment (fullPath);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user