Table of contents |
import javax.swt.*; import javax.swt.event.*; public class Test extends HttpServlet implements ActionListener { private Window window; public void init() {
setup();
}
public void setup() { window = new Window(this, "Test");
window.setLayout(new BorderLayout()); Panel center = new Panel(); Label label = new Label("Hello world!"); center.add(label, BorderLayput.CENTER); window.add(center, BorderLayout.CENTER); }
public void
doGet(HttpServletRequest
req, HttpServletResponse res)
} throws ServletException,
IOException {
window.notify(req, res);
}window.paint(req, res); public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException {
window.notify(req, res);
}window.paint(req, res); public void actionPerformed(ActionEvent e) { Component b = e.getSource();
}System.out.println("actionPerformed on component "+b.getName()+" type="+e.getTypeDescription()); |