For adding attachments a swing JFileChooser is now displayed instead of the AWT FileDialog

This commit is contained in:
edwin%woudt.nl 1999-03-03 10:47:40 +00:00
Родитель bc13359515
Коммит 80cd593817
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -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);
}
}