初学界面设计,再使用GridLayout时大小的控制很凌乱,求大神指教
(希望序列号下面的空白地方小一点。)
贴上代码,代码 规范功力不强,求指导
import javax.swing.*;
import java.awt.*;
public class InfoFrame {
JFrame frame = new JFrame("信息录入");
JPanel panel = new JPanel(); //主面板
JPanel panel1 = new JPanel(); //序列号面板
JPanel panel2 = new JPanel(); //客户信息面板
JPanel panel21 = new JPanel(); //客户子面板
JPanel panel22 = new JPanel(); //客户子面板
JPanel panel23 = new JPanel(); //客户子面板
JPanel panel24 = new JPanel(); //客户子面板
JPanel panel3 = new JPanel(); //代理商面板
JPanel panel31 = new JPanel(); //代理商子面板
JPanel panel32 = new JPanel(); //代理商子面板
JPanel panel33 = new JPanel(); //代理商子面板
JPanel panel4 = new JPanel(); //按钮面板
GridLayout gridlayout = new GridLayout(3,1); //主面板布局方法
GridLayout clientLayout = new GridLayout(5, 1);
GridLayout agentLayout = new GridLayout(4, 1);
FlowLayout layout = new FlowLayout(); //所有面板都使用同种布局
JLabel clientTitleLabel = new JLabel("客户信息");
JLabel agentTitileLabel = new JLabel("代理商信息");
JLabel serNumLabel = new JLabel("序列号");
JTextField serNumText = new JTextField(20);
JLabel clientCompanyLabel = new JLabel("客户名称");
JTextField clientCompanyText = new JTextField(20);
JLabel clientAdressLabel = new JLabel("地址");
Choice clientAdress1Choice = new Choice();
Choice clientAdress2Choice = new Choice();
JLabel clientManLabel = new JLabel("联系人");
JTextField clientManText = new JTextField(20);
JLabel clientPhoneLabel = new JLabel("联系电话");
JTextField clientPhoneText = new JTextField(20);
JLabel agentCompanyLabel = new JLabel("代理商");
JTextField agentCompanyText = new JTextField(20);
JLabel agentManLabel = new JLabel("业务员");
JTextField agentManText = new JTextField(20);
JLabel agentPhoneLabel = new JLabel("联系电话");
JTextField agentPhoneText = new JTextField(20);