diff options
| author | Tobias Spitzer | 2014-05-22 07:55:40 +0200 |
|---|---|---|
| committer | Tobias Spitzer | 2014-05-22 07:55:40 +0200 |
| commit | 2c9da28451b9582e6ad3c5d95d47f0560925addf (patch) | |
| tree | 1f7a815ac073789351eeb7156d61f9280c88d29c /Dozentenmodul/src/gui/intro/VmWareLink_GUI.java | |
| parent | jj (diff) | |
| parent | Download-Links sind nun zentral in der Klasse "Links" festgelegt. (diff) | |
| download | tutor-module-2c9da28451b9582e6ad3c5d95d47f0560925addf.tar.gz tutor-module-2c9da28451b9582e6ad3c5d95d47f0560925addf.tar.xz tutor-module-2c9da28451b9582e6ad3c5d95d47f0560925addf.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tutor-module
Diffstat (limited to 'Dozentenmodul/src/gui/intro/VmWareLink_GUI.java')
| -rw-r--r-- | Dozentenmodul/src/gui/intro/VmWareLink_GUI.java | 71 |
1 files changed, 48 insertions, 23 deletions
diff --git a/Dozentenmodul/src/gui/intro/VmWareLink_GUI.java b/Dozentenmodul/src/gui/intro/VmWareLink_GUI.java index c94586d8..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,14 +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; @@ -46,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. @@ -169,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); @@ -258,5 +271,17 @@ public class VmWareLink_GUI extends JFrame { - } -} + }//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 |
