《Java2图形设计卷II:Swing》配套光盘源码

源代码在线查看: test.java

软件大小: 4504 K
上传用户: guigong
关键词: Java2 Swing 图形 光盘
下载地址: 免注册下载 普通下载 VIP

相关代码

				import javax.swing.*;
				import javax.swing.border.*;
				import java.awt.*;
				import java.awt.event.*;
				
				public class Test extends JApplet {
					public void init() {
						Container contentPane = getContentPane();
				
						JPanel[] panels = { new JPanel(), 
											new JPanel(), new JPanel() };
				
						Border[] borders = { new HandleBorder(),
											new HandleBorder(Color.red, 8),
											new HandleBorder(Color.blue, 10) };
				
						contentPane.setLayout(
									new FlowLayout(FlowLayout.CENTER,20,20));
				
						for(int i=0; i < panels.length; ++i) {
							panels[i].setPreferredSize(new Dimension(100,100));
							panels[i].setBorder(borders[i]);
							contentPane.add(panels[i]);
						}
					}
				}
							

相关资源