JAVA设计界面的程序设计

时间:2014-07-12 10:02:16
【文件属性】:

文件名称:JAVA设计界面的程序设计

文件大小:6KB

文件格式:RAR

更新时间:2014-07-12 10:02:16

界面

涉及页面设计及相关按钮的编辑:import java.awt.*; import java.awt.event.*; /** * Sample application using Frame. * * @author * @version 1.00 11/05/04 */ public class Pj1Frame extends Frame { /** * The constructor. */ public Pj1Frame() { MenuBar menuBar = new MenuBar(); Menu menuFile = new Menu(); MenuItem menuFileExit = new MenuItem(); menuFile.setLabel("File"); menuFileExit.setLabel("Exit"); // Add action listener.for the menu button menuFileExit.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { Pj1Frame.this.windowClosed(); } } ); menuFile.add(menuFileExit); menuBar.add(menuFile); setTitle("Pj1"); setMenuBar(menuBar); setSize(new Dimension(400, 400)); // Add window listener. this.addWindowListener ( new WindowAdapter() { public void windowClosing(WindowEvent e) { Pj1Frame.this.windowClosed(); } } ); } /** * Shutdown procedure when run as an application. */ protected void windowClosed() { // TODO: Check if it is safe to close the application // Exit application. System.exit(0); } }


【文件预览】:
pj1
----p4.java(0B)
----p1.java(3KB)
----pj1.jcd(2KB)
----pj1.jcw(244B)
----p2.java(5KB)
----src()
--------Pj1Frame.java(1KB)
--------Pj1.java(309B)
----pj1.jcu(350B)
----pj1.jcp(782B)
----classes()
----p3.java(3KB)

网友评论