Test Applet
Test Applet
scanner;
import ij.IJ;
import java.awt.Rectangle;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import uk.co.mmscomputing.device.scanner.Scanner;
import uk.co.mmscomputing.device.scanner.ScannerIOException;
/**
*
* @author ambatsur
*
*/
public class TestApplet extends JApplet {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JButton jButton = null;
private JButton jButton1 = null;
private Scanner scanner;
//============================================================ main
public static void main(String[] args) {
//... Create an initialize the applet.
JApplet theApplet = new TestApplet();
//theApplet.init(); // Needed if overridden in applet
//theApplet.start(); // Needed if overridden in applet
//... Create a window (JFrame) and make applet the content pane.
JFrame window = new JFrame("Sample Applet and Application");
window.setContentPane(theApplet);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.pack(); // Arrange the components.
//System.out.println(theApplet.getSize());
window.setVisible(true); // Make the window visible.
}
//=============================================== Applet constructor
public TestApplet() {
initialize();
try {
scanner = Scanner.getDevice();
//scanner.addListener((ScannerListener) this);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void initialize() {
JFrame jf = new JFrame("Sample Applet and Application");
//jf.setContentPane(new TestApplet());
//jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//jf.pack(); // Arrange the components.
//System.out.println(theApplet.getSize());
//jf.setVisible(true); // Make the window visible.