Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
BoxDemo.java
Package: Java.rar [view]
Upload User: szfcled
Upload Date: 2022-06-12
Package Size: 236k
Code Size: 1k
Category:
File Formats
Development Platform:
Java
- import java.awt.*;
- import javax.swing.*;
- public class BoxDemo {
- private JFrame frame;
- private Box bv,bh;
- public static void main(String args[]) {
- BoxDemo that = new BoxDemo();
- that.go();
- }
- void go() {
- frame = new JFrame("Box Layout example");
- Container contentPane = frame.getContentPane();
- //创建使用垂直方向BoxLayout的Box实例
- bv = Box.createVerticalBox();
- bv.add(new JLabel(" Monday"));
- bv.add(new JLabel(" Tuesday"));
- bv.add(new JLabel(" Wednesday"));
- bv.add(new JLabel(" Thursday"));
- bv.add(new JLabel(" Friday"));
- bv.add(new JLabel(" Saturday"));
- bv.add(new JLabel(" Sunday"));
- contentPane.add(bv, BorderLayout.CENTER);
- //创建使用水平方向BoxLayout的Box实例
- bh = Box.createHorizontalBox();
- bh.add(new JButton("Yes"));
- bh.add(new JButton("No"));
- bh.add(new JButton("Cancel"));
- contentPane.add(bh,BorderLayout.SOUTH);
- frame.pack();
- frame.setVisible(true);
- }
- }