JTabbedPane jTabbedpane = new JTabbedPane();// 存放选项卡的组件
JPanel register= new JPanel();
jTabbedpane.addTab("Register", null, register, "first");// 加入第一个页面
jpanelSecond.setLayout(null);//需要设置内容排版格式 不然可能会出现排版混乱
jTabbedpane.setMnemonicAt(0, KeyEvent.VK_0);//
JPanel userINfo = new JPanel();
UserInfoUi.userInfoShow(mainDialog, userINfo, null, rmsg);
jTabbedpane.addTab("USERINFO", null, userINfo, "second");// 加入第二个页面
userINfo.setLayout(null);
jTabbedpane.setMnemonicAt(1, KeyEvent.VK_1);//
jTabbedpane.setSelectedComponent(register); //把register添加到选项卡中
jTabbedpane.setSelectedComponent(userINfo ); //把userINfo 添加到选项卡中
jTabbedpane.setSelectedComponent(userINfo );// 此方法用于在其他事件下切换选项卡