Repository navigation
Expand file tree
/
Copy pathWebCam.java
More file actions
83 lines (77 loc) · 1.72 KB
/
Copy pathWebCam.java
File metadata and controls
83 lines (77 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* WebCam.java
*
* Created on February 24, 2002, 12:25 AM
*/
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/**
*
* @author mike morrison
*/
public class WebCam extends Frame
{
private Applet applet;
private Frame f;
private ImageCanvas imageCanvas;
private TextField input;
public WebCam (Applet a, String host, int port)
{
applet = a;
f = this;
imageCanvas = new ImageCanvas (null, host, port, 30, 320, 240);
imageCanvas.setMainWindow(this);
setTitle ("Webcam viewer: " + host + ":" + port);
f.add (imageCanvas);
f.pack ();
f.show ();
addComponentListener (new ComponentListener ()
{
public void componentHidden (ComponentEvent e)
{
}
public void componentMoved (ComponentEvent e)
{
}
public void componentResized (ComponentEvent e)
{
imageCanvas.setImageSize (e.getComponent ().
getSize ());}
public void componentShown (ComponentEvent e)
{
}
}
);
addWindowListener (new WindowListener ()
{
public void windowActivated (WindowEvent e)
{
}
public void windowClosed (WindowEvent e)
{
}
public void windowClosing (WindowEvent e)
{
System.exit (0);}
public void windowDeactivated (WindowEvent e)
{
}
public void windowDeiconified (WindowEvent e)
{
}
public void windowIconified (WindowEvent e)
{
}
public void windowOpened (WindowEvent e)
{
}
}
);
}
public static void main (String args[])
{
new WebCam (null, args[0], Integer.parseInt (args[1]));
}
}