diff options
| author | Nino Breuer | 2014-05-22 15:41:51 +0200 |
|---|---|---|
| committer | Nino Breuer | 2014-05-22 15:41:51 +0200 |
| commit | 8ee0ed5c5a947ecff257f799dfa60b9b000aab75 (patch) | |
| tree | e5790134d1cada9aee15611f8818fa7da71cd982 /Dozentenmodul/src/gui/intro/VmWareLink_GUI.java | |
| parent | Vorbereitung Multithreading (diff) | |
| parent | Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module (diff) | |
| download | tutor-module-8ee0ed5c5a947ecff257f799dfa60b9b000aab75.tar.gz tutor-module-8ee0ed5c5a947ecff257f799dfa60b9b000aab75.tar.xz tutor-module-8ee0ed5c5a947ecff257f799dfa60b9b000aab75.zip | |
Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module
Conflicts:
Dozentenmodul/bin/gui/intro/Login_GUI.class
Dozentenmodulserver/bin/server/ServerHandler.class
Dozentenmodulserver/bin/server/startServer.class
Dozentenmodulserver/src/server/startServer.java
Diffstat (limited to 'Dozentenmodul/src/gui/intro/VmWareLink_GUI.java')
| -rw-r--r-- | Dozentenmodul/src/gui/intro/VmWareLink_GUI.java | 109 |
1 files changed, 85 insertions, 24 deletions
diff --git a/Dozentenmodul/src/gui/intro/VmWareLink_GUI.java b/Dozentenmodul/src/gui/intro/VmWareLink_GUI.java index 1c0a51c0..4d610587 100644 --- a/Dozentenmodul/src/gui/intro/VmWareLink_GUI.java +++ b/Dozentenmodul/src/gui/intro/VmWareLink_GUI.java @@ -7,7 +7,6 @@ import java.awt.FlowLayout; import java.awt.Toolkit; import javax.swing.JFrame; import javax.swing.JButton; -import javax.swing.JDialog; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.UIManager; @@ -29,12 +28,13 @@ import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.net.URL; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JCheckBox; import javax.swing.event.ChangeListener; import javax.swing.event.ChangeEvent; - +import models.Links; import org.ini4j.InvalidFileFormatException; import org.ini4j.Wini; @@ -44,19 +44,11 @@ public class VmWareLink_GUI extends JFrame { private final JPanel contentPanel = new JPanel(); String[] result; + //String uriWindows="https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0"; + //String uriLinux="https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0"; JCheckBox chckbxNewCheckBox; - /** - * Launch the application. - */ - public static void main(String[] args) { - try { - VmWareLink_GUI dialog = new VmWareLink_GUI(); - dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - dialog.setVisible(true); - } catch (Exception e) { - e.printStackTrace(); - } - } + private JButton btnWindows; + /** * Create the dialog. @@ -167,13 +159,36 @@ public class VmWareLink_GUI extends JFrame { lbllinuxvmwarePlayer.setBounds(10, 178, 499, 14); contentPanel.add(lbllinuxvmwarePlayer); - JLabel lblvmwarePlayerDownload = new JLabel("<html><a href=\"https:////my.vmware.com//web//vmware//free#desktop_end_user_computing//vmware_player//6_0\" >vmWare Player Download</a></html>"); - lblvmwarePlayerDownload.setBounds(10, 118, 499, 14); - contentPanel.add(lblvmwarePlayerDownload); + btnWindows = new JButton("VMware Player herunterladen"); + btnWindows.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + try { + URI windows= new URI(Links.getUriWindows()); + openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + btnWindows.setBounds(10, 119, 186, 23); + contentPanel.add(btnWindows); - JLabel lblvmwarePlayerDownload_1 = new JLabel("<html><a href=\"https:////my.vmware.com//web//vmware//free#desktop_end_user_computing//vmware_player//6_0\" >vmWare Player Download</a></html>"); - lblvmwarePlayerDownload_1.setBounds(10, 203, 499, 14); - contentPanel.add(lblvmwarePlayerDownload_1); + JButton btnLinux = new JButton("VMware Player herunterladen"); + btnLinux.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + try { + URI windows= new URI(Links.getUriLinux()); + openWebpage(windows); + } catch (URISyntaxException f) { + // TODO Auto-generated catch block + f.printStackTrace(); + } + } + }); + btnLinux.setBounds(10, 203, 186, 23); + contentPanel.add(btnLinux); { JPanel buttonPane = new JPanel(); buttonPane.setBounds(0, 630, 587, 33); @@ -211,16 +226,62 @@ public class VmWareLink_GUI extends JFrame { menuBar.add(mnHilfe); { JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + String faq; + + faq = Links.getFAQ(); + + try { + Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + faq ); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnHilfe.add(mntmFaq); } { - JMenuItem mntmHilfe = new JMenuItem("Hilfe"); - mnHilfe.add(mntmHilfe); + JMenuItem mntmOTRS = new JMenuItem("OTRS"); + mntmOTRS.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + String otrs; + + otrs = Links.getOTRS(); + + try { + Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + otrs ); + } catch (IOException f) { + // TODO Auto-generated catch block + f.printStackTrace(); + } + + } + }); + + mnHilfe.add(mntmOTRS); } } } - } -} + }//end constructor + + public static void openWebpage(URI uri) { + Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null; + if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { + try { + desktop.browse(uri); + } catch (Exception e) { + e.printStackTrace(); + } + } + }// end openWebpage + +}// end class |
