From e5dfd4e457635ff292190cd800cf9ade0ec7cd8c Mon Sep 17 00:00:00 2001 From: tspitzer Date: Mon, 9 Sep 2013 15:59:37 +0200 Subject: Alle GUIs für das bauen einer VL auf Basis einer Rohling sind fertig. Nun muss noch die DB Anbindung implementiert werden --- Dozentenmodul/src/GUI/Downloader.java | 117 ---------------------------------- 1 file changed, 117 deletions(-) delete mode 100644 Dozentenmodul/src/GUI/Downloader.java (limited to 'Dozentenmodul/src/GUI/Downloader.java') diff --git a/Dozentenmodul/src/GUI/Downloader.java b/Dozentenmodul/src/GUI/Downloader.java deleted file mode 100644 index 8a44c38b..00000000 --- a/Dozentenmodul/src/GUI/Downloader.java +++ /dev/null @@ -1,117 +0,0 @@ -package GUI; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; - -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JFileChooser; -import javax.swing.JPanel; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import java.awt.Color; -import javax.swing.SwingConstants; -import javax.swing.JLabel; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.io.File; -import javax.swing.JProgressBar; - -import ftp.ftp; - -public class Downloader extends JDialog { - - private final JPanel contentPanel = new JPanel(); - JLabel lblNewLabel; - JProgressBar progressBar; - ftp f=new ftp(); - /** - * Launch the application. - */ - public static void main(String[] args) { - try { - Downloader dialog = new Downloader(); - dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - dialog.setVisible(true); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * Create the dialog. - */ - public Downloader() { - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setBackground(Color.WHITE); - setTitle("Downloader"); - setBounds(100, 100, 450, 218); - getContentPane().setLayout(new BorderLayout()); - contentPanel.setBackground(Color.WHITE); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel, BorderLayout.CENTER); - contentPanel.setLayout(null); - { - JButton btnSpeicherortAuswhlen = new JButton("Speicherort ausw\u00E4hlen"); - btnSpeicherortAuswhlen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - JFileChooser fc=new JFileChooser(); - fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - - fc.showOpenDialog(getParent()); - File dir=fc.getSelectedFile(); - lblNewLabel.setText(dir.getAbsolutePath()); - } - }); - btnSpeicherortAuswhlen.setBounds(10, 11, 141, 23); - btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); - btnSpeicherortAuswhlen.setHorizontalAlignment(SwingConstants.LEFT); - contentPanel.add(btnSpeicherortAuswhlen); - } - - lblNewLabel = new JLabel("C:\\"); - lblNewLabel.setBounds(169, 11, 255, 23); - contentPanel.add(lblNewLabel); - - JButton btnDownloadStarten = new JButton("Download starten"); - btnDownloadStarten.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - progressBar.setValue(0); - long fsize=f.getFileSize("BESCHREIBUNG.xml"); - f.getFile("BESCHREIBUNG.xml", lblNewLabel.getText().toString()); - } - }); - btnDownloadStarten.setBounds(10, 106, 141, 23); - contentPanel.add(btnDownloadStarten); - - progressBar = new JProgressBar(0,100); - progressBar.setBounds(10, 45, 414, 30); - contentPanel.add(progressBar); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBackground(Color.WHITE); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane, BorderLayout.SOUTH); - { - JButton okButton = new JButton("OK"); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); - } - { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton); - } - } - } -} -- cgit v1.2.3-55-g7522