创建一个窗体

import java.awt.Container; import javax.swing.*; import java.awt.*; public class Example extends JFrame { public void CreateJFrame(String title) { JFrame jf=new JFrame(title); Container container=jf.getContentPane(); JLabel jl=new JLabel("这是一个JFrame窗体"); jl.setHorizontalAlig...
默认分类 | 2016-03-04 16:13 | 阅读 12461 次 | 评论 0 条

java继承的例子

import java.util.Date; class Employee { private String name; private double salary; private Date birthday; public Employee() { } public Employee(String name,double salary,Date birthday) { this.name=name; this.salary=salary; this.birthday=birthday; } p...
默认分类 | 2016-03-02 12:50 | 阅读 12897 次 | 评论 0 条

servlet编程(实现servlet接口方法)

import javax.servlet.*; import java.io.*; public class Hello implements Servlet { public void init(ServletConfig parml) throws ServletException { System.out.println("init"); } public ServletConfig getServletConfig() { return null; } public void service(ServletReques...
默认分类 | 2016-03-02 09:02 | 阅读 11702 次 | 评论 0 条
文章分类