You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.4 KiB
63 lines
1.4 KiB
package de.memtext.dlg; |
|
|
|
import java.awt.Frame; |
|
import java.io.File; |
|
|
|
import javax.swing.JLabel; |
|
|
|
import de.memtext.util.FilenamesFilter; |
|
import de.memtext.util.WindowUtils; |
|
import de.memtext.widgets.FileSelectionPanel; |
|
import de.memtext.widgets.VerticalBox; |
|
|
|
public class ImportDlg extends OkCancelDlg { |
|
private JLabel lblTop = new JLabel(); |
|
private FileSelectionPanel fsp = new FileSelectionPanel("Datei"); |
|
|
|
public ImportDlg(Frame owner, String title, String infoTxt) { |
|
super(owner, title, true); |
|
VerticalBox vbox = new VerticalBox(); |
|
lblTop.setText(infoTxt); |
|
vbox.add(lblTop); |
|
vbox.add(fsp); |
|
setCenter(vbox); |
|
this.pack(); |
|
WindowUtils.center(this); |
|
|
|
} |
|
|
|
public void setCurrentDir(File defaultdir) |
|
{ |
|
fsp.setCurrentDir(defaultdir); |
|
} |
|
/** |
|
|
|
* @param endings |
|
*/ |
|
public void setFileFilter(String endings) { |
|
fsp.setFileFilter(new FilenamesFilter("CSV oder XML Dateien", endings)); |
|
} |
|
|
|
protected void performOk() { |
|
this.dispose(); |
|
} |
|
|
|
protected void performCancel() { |
|
this.dispose(); |
|
} |
|
|
|
public File getSelectedFile() { |
|
return fsp.getSelectedFile(); |
|
} |
|
|
|
public static void main(String[] args) { |
|
ImportDlg d = |
|
new ImportDlg( |
|
null, |
|
"titl", |
|
"Unfälle importieren aus CSV- oder XML-Datei (z.B. Universum Unfallanzeige 3.0)"); |
|
d.setFileFilter(".xml|.csv"); |
|
d.show(); |
|
} |
|
} |
|
//Created on 19.02.2004 at 11:56:06
|