diff options
Diffstat (limited to 'Dozentenmodul/src/gui/intro/VmWareLink_GUI.java')
| -rw-r--r-- | Dozentenmodul/src/gui/intro/VmWareLink_GUI.java | 68 |
1 files changed, 45 insertions, 23 deletions
diff --git a/Dozentenmodul/src/gui/intro/VmWareLink_GUI.java b/Dozentenmodul/src/gui/intro/VmWareLink_GUI.java index 607ccf17..59f47f4b 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; @@ -34,9 +33,7 @@ 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; @@ -47,18 +44,8 @@ public class VmWareLink_GUI extends JFrame { private final JPanel contentPanel = new JPanel(); String[] result; 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 +156,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); @@ -242,5 +252,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 |
