这里面包含了一百多个JAVA源文件

源代码在线查看: e873. creating and setting a border.txt

软件大小: 551 K
上传用户: maple_78
关键词: JAVA
下载地址: 免注册下载 普通下载 VIP

相关代码

				There are several types of borders available, each represented by its own class. A border can be created using the class' constructor or using a border factory. The border factory is the typical method for creating a border since it creates the border using values that are compatible with the current look and feel. However, if custom values are required, the border should be created using a constructor. 
				This example creates one of each of the available borders. See also e874 Adding a Title to a Border. 
				
				    // Create a border
				    EmptyBorder emptyBorder = (EmptyBorder)BorderFactory.createEmptyBorder();
				    
				    LineBorder lineBorder = (LineBorder)BorderFactory.createLineBorder(Color.black);
				    
				    EtchedBorder etchedBorder = (EtchedBorder)BorderFactory.createEtchedBorder();
				    
				    BevelBorder raisedBevelBorder = (BevelBorder)BorderFactory.createRaisedBevelBorder();
				    
				    BevelBorder loweredBevelBorder = (BevelBorder)BorderFactory.createLoweredBevelBorder();
				    
				    ImageIcon icon = new ImageIcon("image.gif");
				    MatteBorder matteBorder = (MatteBorder)BorderFactory.createMatteBorder(-1, -1, -1, -1, icon);
				    
				    
				    // Set the border
				    component.setBorder(emptyBorder);
				
							

相关资源