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

📄 testborderlayout.java

📁 java2 primer plus一书源程序
💻 JAVA
字号:
/* * TestBorderLayout.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 TestBorderLayout extends Frame{      TextField tfNorth;   TextField tfCenter;   TextField tfSouth;   TextField tfEast;   TextField tfWest;      /** Creates new TestBorderLayout */   public TestBorderLayout()   {      tfNorth = new TextField("North");      tfCenter= new TextField("Center");      tfSouth = new TextField("South");      tfEast = new TextField("East");      tfWest = new TextField("West");            Panel pNorth = new Panel();      pNorth.add(tfNorth);      Panel pCenter = new Panel();      pCenter.setBackground(Color.darkGray);      pCenter.add(tfCenter);      Panel pSouth = new Panel();      pSouth.add(tfSouth);      Panel pEast = new Panel();      pEast.setBackground(Color.gray);      pEast.add(tfEast);      Panel pWest = new Panel();      pWest.setBackground(Color.gray);      pWest.add(tfWest);      add(pNorth, BorderLayout.NORTH);      add(pCenter, BorderLayout.CENTER);      add(pSouth, BorderLayout.SOUTH);      add(pEast, BorderLayout.EAST);      add(pWest, BorderLayout.WEST);                  addWindowListener(new WinCloser());      setTitle("Using a BorderLayout");      setBounds( 100, 100, 300, 300);      setVisible(true);   }      public static void main(String[] args)   {      TestBorderLayout tbl = new TestBorderLayout();   }   }class WinCloser extends WindowAdapter{   public void windowClosing(WindowEvent e)   {      System.exit(0);   }}

⌨️ 快捷键说明

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