1 /***
2 * Created on Jun 29, 2005, Copyright UC Regents
3 */
4 package org.telscenter.pas.util;
5
6 import java.util.logging.Logger;
7
8 import java.awt.BorderLayout;
9 import java.awt.Container;
10 import java.awt.event.ActionEvent;
11 import java.awt.event.ActionListener;
12 import java.io.IOException;
13 import java.net.SocketException;
14 import java.net.UnknownHostException;
15
16 import javax.swing.JFrame;
17 import javax.swing.JLabel;
18 import javax.swing.JTextField;
19
20
21
22 import net.sf.sail.common.messaging.multicast.Multicaster;
23
24 /***
25 * @author turadg
26 */
27 public class ClassroomShouter extends JFrame {
28 /***
29 * Logger for this class
30 */
31 private static final Logger logger = Logger
32 .getLogger(ClassroomShouter.class.getName());
33
34 Multicaster multicaster;
35
36 /***
37 *
38 */
39 public ClassroomShouter() {
40 super("Classroom Shouter");
41 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
42
43 try {
44 multicaster = new Multicaster();
45 } catch (UnknownHostException e) {
46
47 logger.severe("exception: " + e);
48 } catch (SocketException e) {
49
50 logger.severe("exception: " + e);
51 }
52
53 Container content = getContentPane();
54
55 content.setLayout(new BorderLayout());
56 JLabel label = new JLabel();
57 label.setText("Type a message to shout and hit enter to send");
58 content.add(label, BorderLayout.NORTH);
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 pack();
74 }
75
76 public static void main(String[] args) throws IOException {
77 ClassroomShouter t = new ClassroomShouter();
78 t.setVisible(true);
79 }
80
81 }