仿QQ聊天软件及源码java版(五)

2014-11-24 03:14:15 · 作者: · 浏览: 3
,BorderLayout.WEST);

userInfoButton.setMargin(new Insets(0,0,0,10));//Margin:边距 insets:插入

initUserInfoButton();// 初始化本地用户头像按钮

BannerPanel.add(messageAlertButton,BorderLayout.CENTER);

messageAlertButton.addActionListener(new ActionListener(){

@Override

public void actionPerformed(ActionEvent arg0) {

if(!messageStack.empty()){

showMessageDialog(messageStack.pop());//堆栈顶部的对象(Vector 对象中的最后一项)。

}

}

});

messageAlertButton.setIcon(messageAlertIcon);

showMessageBar();

}

this.add(tabbedPane,BorderLayout.CENTER);

tabbedPane.setTabPlacement(SwingConstants.LEFT);//设置此选项卡窗格的选项卡布局

ImageIcon userTicon = new ImageIcon(EQ.class.getResource("/image/tabIcon/tabLeft.PNG"));

tabbedPane.addTab(null,userTicon,createUserList(),"用户列表");

ImageIcon sysOTicon = new ImageIcon(EQ.class.getResource("/image/tabIcon/tabLeft2.PNG"));

tabbedPane.addTab(null, sysOTicon, createSysToolPanel(), "系统操作");

ImageIcon sysSTicon = new ImageIcon(EQ.class.getResource("/image/tabIcon/tabLeft3.png"));

tabbedPane.addTab(null, sysSTicon, createSysSetPanel(), "系统设置");

this.setAlwaysOnTop(true);//总在顶部

}

//----------------------------------------------------------------------------------

private JScrollPane createSysSetPanel(){//系统设置面板

final JPanel sysSetPanel = new JPanel();

JScrollPane scrollPane = new JScrollPane(sysSetPanel);

sysSetPanel.setLayout(new BoxLayout(sysSetPanel,BoxLayout.Y_AXIS));

scrollPane.setBorder(new EmptyBorder(0,0,0,0));

final JPanel sysPathPanel = new JPanel();

sysPathPanel.setMaximumSize(new Dimension(600,200));

sysPathPanel.setBorder(new TitledBorder("系统路径"));//title - 边框应显示的标题

sysPathPanel.setLayout(new GridLayout(0,1));

sysSetPanel.add(sysPathPanel);

sysPathPanel.add(new JLabel("程序升级路径"));

updatePathTField = new JTextField(preferences.get("updatePath", "请输入路径"));

sysPathPanel.add(updatePathTField);

sysPathPanel.add(new JLabel("系统公告路径:"));

placardPathTField = new JTextField(preferences.get("placardPath","请输入路径"));

sysPathPanel.add(placardPathTField);

sysPathPanel.add(new JLabel("公共程序路径:"));

pubPathTField = new JTextField(preferences.get("pubPath", "请输入路径"));

sysPathPanel.add(pubPathTField);

final JButton pathOKButton = new JButton("确定");

pathOKButton.setActionCommand("sysOK");

pathOKButton.addActionListener(new SysSetPanelOKListener());

sysSetPanel.add(pathOKButton);

final JPanel loginPanel = new JPanel();

loginPanel.setMaximumSize(new Dimension(600, 90));

loginPanel.setBorder(new TitledBorder("登录升级服务器"));

final GridLayout gridLayout_1 = new GridLayout(0, 1);

gridLayout_1.setVgap(5);

loginPanel.setLayout(gridLayout_1);

sysSetPanel.add(log