diff options
Diffstat (limited to 'source/client/swing/ZApplet.java')
| -rw-r--r-- | source/client/swing/ZApplet.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source/client/swing/ZApplet.java b/source/client/swing/ZApplet.java new file mode 100644 index 0000000..0ecd92a --- /dev/null +++ b/source/client/swing/ZApplet.java @@ -0,0 +1,46 @@ +package itunes.client.swing; +import javax.swing.*; +import java.awt.event.*; +public class ZApplet extends JApplet { + private ZPlayer app; + public void init() + { + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception e) { + e.printStackTrace(); + } + JButton jb = new JButton("Launch ZPlayer"); + jb.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { createNewPlayer(); } + }); + this.getContentPane().add(jb); + } + public void createNewPlayer() + { + if(app == null) + { + app = new ZPlayer(true); + app.frame.addWindowListener(new WindowListener() { + public void windowClosed(WindowEvent e) {} + public void windowClosing(WindowEvent e) { + app = null; + } + public void windowDeiconified(WindowEvent e) {} + public void windowIconified(WindowEvent e) {} + public void windowActivated(WindowEvent e) {} + public void windowDeactivated(WindowEvent e) {} + public void windowOpened(WindowEvent e) {} + }); + app.connectToHost(getParameter("host")); + } + else + { + app.frame.toFront(); + } + } + public void stop() + { + app.logOut(); + } +}
\ No newline at end of file |
