发布时间 : 星期六 文章Java聊天室毕业论文更新完毕开始阅读89049ae59b89680203d8259a
河南理工大学本科生毕业设计(论文)说明书
vent.CTRL_MASK)); exitItem.setMnemonic('X');
exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X,InputEvent.CTRL_MASK)); helpMenu.setMnemonic('H'); helpItem.setMnemonic('H');
helpItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H,InputEvent.CTRL_MASK)); }
public void init() {
Container contentPane=getContentPane(); contentPane.setLayout(new BorderLayout()); serviceMenu.add(portItem); serviceMenu.add(startItem); serviceMenu.add(stopItem); serviceMenu.add(exitItem); jMenuBar.add(serviceMenu); helpMenu.add(helpItem); jMenuBar.add(helpMenu); setJMenuBar(jMenuBar); portSet=new JButton(\端口设置\ startServer=new JButton(\启动服务\ stopServer=new JButton(\停止服务\ exitButton=new JButton(\退出\ toolBar.add(portSet); toolBar.addSeparator(); toolBar.add(startServer);
20
河南理工大学本科生毕业设计(论文)说明书
toolBar.add(stopServer); toolBar.addSeparator(); toolBar.add(exitButton);
contentPane.add(toolBar,BorderLayout.NORTH); stopServer.setEnabled(false); stopItem.setEnabled(false); portItem.addActionListener(this); startItem.addActionListener(this); stopItem.addActionListener(this); exitItem.addActionListener(this); helpItem.addActionListener(this); portSet.addActionListener(this); startServer.addActionListener(this); stopServer.addActionListener(this); exitButton.addActionListener(this); combobox=new JComboBox(); combobox.insertItemAt(\所有人\ combobox.setSelectedIndex(0); messageShow=new JTextArea(); messageShow.setEditable(false); messageScrollPane=new
JScrollPane(messageShow,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); messageScrollPane.setPreferredSize(new Dimension(400,400)); messageScrollPane.revalidate(); showStatus=new JTextField(35); showStatus.setEditable(false);
21
河南理工大学本科生毕业设计(论文)说明书
sysMessage=new JTextField(23); sysMessage.setEnabled(false); sysMessageButton=new JButton(); sysMessageButton.setText(\发送\ sysMessage.addActionListener(this); sysMessageButton.addActionListener(this); sendToLabel=new JLabel(\发送至:\ messageLabel=new JLabel(\发送消息:\ downPanel=new JPanel(); gridBag=new GridBagLayout(); downPanel.setLayout(gridBag); gridBagCon=new GridBagConstraints(); gridBagCon.gridx=0; gridBagCon.gridy=0; gridBagCon.gridwidth=3; gridBagCon.gridheight=2; gridBagCon.ipadx=5; gridBagCon.ipady=5;
JLabel none=new JLabel(\ \ gridBag.setConstraints(none,gridBagCon); downPanel.add(none);
gridBagCon=new GridBagConstraints(); gridBagCon.gridx=0; gridBagCon.gridy=2;
gridBagCon.insets=new Insets(1,0,0,0); gridBagCon.ipadx=5; gridBagCon.ipady=5;
22
河南理工大学本科生毕业设计(论文)说明书
gridBag.setConstraints(sendToLabel,gridBagCon); downPanel.add(sendToLabel);
gridBagCon=new GridBagConstraints(); gridBagCon.gridx=1; gridBagCon.gridy=2;
gridBagCon.anchor=GridBagConstraints.LINE_START; gridBag.setConstraints(combobox,gridBagCon); downPanel.add(combobox);
gridBagCon=new GridBagConstraints(); gridBagCon.gridx=0; gridBagCon.gridy=3;
gridBag.setConstraints(messageLabel,gridBagCon); downPanel.add(messageLabel); gridBagCon=new GridBagConstraints(); gridBagCon.gridx=1; gridBagCon.gridy=3;
gridBag.setConstraints(sysMessage,gridBagCon); downPanel.add(sysMessage);
gridBagCon=new GridBagConstraints(); gridBagCon.gridx=2; gridBagCon.gridy=3;
gridBag.setConstraints(sysMessageButton,gridBagCon); downPanel.add(sysMessageButton); gridBagCon=new GridBagConstraints(); gridBagCon.gridx=0; gridBagCon.gridy=4; gridBagCon.gridwidth=3;
23