Java Webterm
[Example Web Pages]

The "../src/webpages/webterm" folder contains an example of how to use a Java Applet with a Modtronix Ethernet board. The Applet doesn't do much, and can be customized by the user. This example consists of the following files: The "index.htm" file is very small, and only includes the applet that has been placed in a JAR file.

index.htm

<html>
<head>
<title>Very simple PIC port example</title>
</head>

<!-- Place all code containing % tags in main.cgi file. This has to be done seeing that -->
<!-- htm files are not parsed for % tags by default, but only cgi files! -->
<iframe name=main src="main.cgi" height="100%" width="100%" scrolling="no" frameborder=0></iframe>

</body>
</html>

The "Webterm.java" file contains the Java code.

Webterm.java

/*
 * Created on Jan 14, 2005
 */
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.HeadlessException;

import javax.swing.BorderFactory;
import javax.swing.JApplet;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;


public class Webterm extends JApplet {
    JPanel paneTop = new JPanel(); 
    JTextArea txtarea = new JTextArea();
    
    public Webterm() throws HeadlessException {
        super();
        
        //getRootPane().putClientProperty("defeatSystemEventQueueCheck",
        //        Boolean.TRUE);
    }
    
    public void init() {
        //Configure label
        JLabel label = new JLabel("Web Based Terminal");
        label.setHorizontalAlignment(JLabel.CENTER);

        //Configure panetop
        //txtarea.setBorder(BorderFactory.createMatteBorder(1,1,2,2,Color.black));
        paneTop.setLayout(new BorderLayout());
        paneTop.add(label, BorderLayout.NORTH);
        paneTop.add(txtarea, BorderLayout.CENTER);
        getContentPane().add(paneTop, BorderLayout.CENTER);
        
        txtarea.append("hello\r\n");
        txtarea.append("there\r\n");
        txtarea.append("CodeBase: " + this.getCodeBase().toString() + "\r\n");
        txtarea.append("DocumentBase: " + this.getDocumentBase().toString() + "\r\n");
    }
}

Screen Shots

webterm_index.gif

Generated on Wed Feb 3 12:45:36 2010 for SBC65EC Web Server by  doxygen 1.5.8