步骤 2 : 布局规划 步骤 3 : 设置界面ConfigPanel 代码讲解 
					本面板使用BorderLayout,分北面和居中。 
					
				北面是一个JPanel,里面放4个组件,使用4行1列的GridLayout的布局 居中是一个JPanel,就放了一个按钮 this.setLayout(new BorderLayout()); this.add(pInput, BorderLayout.NORTH); this.add(pSubmit, BorderLayout.CENTER); 
				
					
						增值内容,请先登录
					
				
				 
		
					
		
		
					
					完整的J2SE桌面项目,从无到有完整的开发流程,涵盖全部52个知识点,154个开发步骤, 一共36个讲解视频,累计时长3小时10分59秒,大小1.94G,充实J2SE项目经验,为简历加上一个有吸引力的砝码
					 
			增值内容,点击购买 
					使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
					 
					
				package gui.panel;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import util.ColorUtil;
import util.GUIUtil;
public class ConfigPanel extends JPanel {
	static{
		GUIUtil.useLNF();
	}
	public static ConfigPanel instance = new ConfigPanel();
	JLabel lBudget = new JLabel("本月预算(¥)");
	public JTextField tfBudget = new JTextField("0");
	
	JLabel lMysql = new JLabel("Mysql安装目录");
	public JTextField tfMysqlPath = new JTextField("");
	JButton bSubmit = new JButton("更新");
	public ConfigPanel() {
		GUIUtil.setColor(ColorUtil.grayColor, lBudget,lMysql);
		GUIUtil.setColor(ColorUtil.blueColor, bSubmit);
		
		JPanel pInput =new JPanel();
		JPanel pSubmit = new JPanel();
		int gap =40;
		pInput.setLayout(new GridLayout(4,1,gap,gap));
		
		pInput.add(lBudget);
		pInput.add(tfBudget);
		pInput.add(lMysql);
		pInput.add(tfMysqlPath);
		this.setLayout(new BorderLayout());
		this.add(pInput,BorderLayout.NORTH);
		
		pSubmit.add(bSubmit);
		this.add(pSubmit,BorderLayout.CENTER);
		
	}
	public static void main(String[] args) {
		GUIUtil.showPanel(ConfigPanel.instance);
	}
	
}
 
								
										
									
								
							
				HOW2J公众号,关注后实时获知最新的教程和优惠活动,谢谢。
			 
			 
			
			
			
			
			
		
		
		
		 	问答区域     
		 	
				
		  
	 
	  		
	  
	  	2023-05-25
	  		
	  				
	  					 
	  
					
						设置界面的设置mysql 
					
					
						
							
						
											
							
					
					
					
	   
	  
	  
	  
 
		回答已经提交成功,正在审核。 请于 我的回答 处查看回答记录,谢谢	
	 
	  		
	  
	  	2022-05-13
	  		
	  				
	  					 
	  
					
						按钮不应该是public吗, 后面加监听的时候访问不到吧 
					
					
						
							
						
											
							
					
					
					
	   
	  
	  
	  	    
	    
	  
	  		
	  
	  	2021-04-07
	  		
	  				
	  					 
	  
					
						gap是什么参数? 
					
					
						
							
						
											
							
					
					
					
	   
	  
	  
	  	    
	    
	  
	  		
	  
	  	2020-10-28
	  		
	  				
	  					 
	  
					
						记录 
					
					
						
							
						
											
							
					
					
					
	   
	  
	  
	  	    
	    
	  
	  		
	  
	  	2019-04-21
	  		
	  				
	  					 
	  
					
						为什么要mysql标签? 
					
					
						
							
						
											
							
					
					
					
	   
	  
	  
	  	    
	    
	  
			
			提问之前请登陆
			
		 
		提问已经提交成功,正在审核。 请于 我的提问 处查看提问记录,谢谢	
	 
 | 
	|||||||||||||||