⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testpanel.java

📁 java2 primer plus一书源程序
💻 JAVA
字号:
/* * TestPanel.java * * Created on July 30, 2002, 11:35 AM */package com.samspublishing.jpp.ch13;import java.awt.*;import java.awt.event.*;/** * * @author  Stephen Potts * @version */public class TestPanel extends Frame{   TextField tf1;   TextField tf2;      /** Creates new TestPanel */   public TestPanel()   {      tf1 = new TextField("Directly on the Panel");      tf2 = new TextField("Following the first TextField");      Panel p1 = new Panel();      p1.add(tf1);      p1.add(tf2);      add(p1);      addWindowListener(new WinCloser());      setTitle("Using a Panel");      setBounds( 100, 100, 300, 300);      setVisible(true);   }      public static void main(String[] args)   {      TestPanel tp = new TestPanel();   }   }class WinCloser extends WindowAdapter{   public void windowClosing(WindowEvent e)   {      System.exit(0);   }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -