package GUI; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Toolkit; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; import java.awt.Color; import javax.swing.JLabel; import java.awt.Font; import javax.swing.JTextPane; import java.awt.SystemColor; import javax.swing.JTextField; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.net.SocketException; import java.rmi.RemoteException; import java.security.NoSuchAlgorithmException; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.awt.List; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JSeparator; import javax.swing.JMenuBar; import javax.swing.JMenu; import javax.swing.JMenuItem; import downloader.FTPException; import downloader.FTPUtility; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JComboBox; import javax.swing.DefaultComboBoxModel; import rmi.RmiClientMethods; import server.ServerInterface; import Models.User; @SuppressWarnings("serial") public class searchRohling extends JFrame { private final JPanel contentPanel = new JPanel(); private JTextField textFieldsearch; List list; ArrayList result; String host="141.79.128.121"; User user; int port=21; RmiClientMethods rmi=new RmiClientMethods(); ServerInterface sint=rmi.getInterface(); //FTPUtility f=new FTPUtility(host, port, user.getUsername(), user.getPass()); /** * Launch the application. */ public static void main(String[] args) { try { searchRohling dialog = new searchRohling(); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } /** * Create the dialog. */ public searchRohling() { getContentPane().setEnabled(false); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { // TODO Auto-generated catch block e.printStackTrace(); } setTitle("Dozentenmodul *Prototyp*"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top=(screenSize.height - 603) / 2; int left=(screenSize.width - 722) / 2; setBounds(left, top, 603, 722); //setBounds(100, 100, 603, 722); getContentPane().setLayout(null); { JPanel panel = new JPanel(); panel.setBounds(0, 0, 577, 71); getContentPane().add(panel); panel.setLayout(null); { JLabel lblNewLabel = new JLabel("Rohling ausw\u00E4hlen (Schritt 1 von 7)"); lblNewLabel.setBounds(10, 11, 509, 22); panel.add(lblNewLabel); lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18)); } JTextPane txtpnBitteWhlenSie = new JTextPane(); txtpnBitteWhlenSie.setEditable(false); txtpnBitteWhlenSie.setBackground(SystemColor.menu); txtpnBitteWhlenSie.setText("Bitte w\u00E4hlen Sie nun Ihr gew\u00FCnschtes Rohling aus und klicken Sie auf Download. Sollten Sie schon im Besitz Ihres gew\u00FCnschten Rohlings sein klicken Sie auf weiter."); txtpnBitteWhlenSie.setBounds(10, 36, 509, 42); panel.add(txtpnBitteWhlenSie); } contentPanel.setBounds(10, 126, 567, 446); contentPanel.setBackground(Color.WHITE); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel); contentPanel.setLayout(null); list = new List(); list.setBounds(10, 10, 547, 426); contentPanel.add(list); { JPanel buttonPane = new JPanel(); buttonPane.setBounds(0, 630, 587, 33); buttonPane.setBackground(SystemColor.menu); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane); { JButton okButton = new JButton("Zur\u00FCck"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { MainMenue_GUI ac=new MainMenue_GUI(); ac.setVisible(true); dispose(); } }); okButton.setActionCommand("OK"); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } { JButton cancelButton = new JButton("Weiter"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { VmWareLink_GUI vp=new VmWareLink_GUI(); vp.setVisible(true); dispose(); } }); cancelButton.setActionCommand("Cancel"); buttonPane.add(cancelButton); } } JButton btnDownload = new JButton("Download"); btnDownload.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { FTPDownloader_GUI ftp=new FTPDownloader_GUI(list.getItem(list.getSelectedIndex()).toString()); ftp.setVisible(true); } }); btnDownload.setBounds(488, 583, 89, 23); getContentPane().add(btnDownload); textFieldsearch = new JTextField(); textFieldsearch.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent arg0) { System.out.println(textFieldsearch.getText().toString());}} /*list.removeAll(); for(int i=0;i