?? helpgui.java
字號:
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.net.*;
import java.util.*;
import javax.swing.text.*;
import javax.swing.event.*;
public class HelpGUI extends JFrame implements ActionListener
{
JButton ten ;
public HelpGUI()
{
super("小布點聊天室----幫助中心");
Container c = this.getContentPane();
JPanel p = new JPanel();
GridBagLayout gb = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
p.setLayout(gb);
c.add(p);
JLabel one = new JLabel(" 歡 迎 使 用 小 布 點 聊 天 室 幫 助 中 心 ");
JLabel two = new JLabel(" 本軟件操作流程如下: ");
JLabel three = new JLabel(" 一:使用本軟件的新用戶必須先注冊一個用戶名。");
JLabel four = new JLabel (" 二:新用戶在登錄框內寫入正確的用戶名和密碼即可進行在線聊天。");
JLabel five = new JLabel (" 三:因為本軟件是采用局域網進行上線聊天,因此新用戶必須填寫正確的 IP 號。");
JLabel six = new JLabel (" 四:新用戶在填寫(注冊)時必須完整填寫所有需要填寫的內容,這便于用戶以后的永久使用!!。 ");
JLabel seven = new JLabel(" 非常感謝您使用小布聊天軟件!!");
JLabel eight = new JLabel(" 小布點聊天室開發小組 ");
JLabel nine = new JLabel(" 2008年3月24日 編");
ten = new JButton(" 確 定 ");
// JLabel one = new JLabel("");
// JLabel one = new JLabel("");
// JLabel one = new JLabel("");
// JLabel one = new JLabel("");
// JLabel one = new JLabel("");
// JLabel one = new JLabel("");
// JLabel one = new JLabel("");
// JLabel one = new JLabel("");
// JLabel one = new JLabel("");
Font f = new Font("黑體",Font.BOLD+Font.ROMAN_BASELINE,20);
Font f1 = new Font("黑體",Font.BOLD+Font.TRUETYPE_FONT,17);
one.setFont(f);
two.setFont(f1);
three.setFont(f1);
four.setFont(f1);
five.setFont(f1);
six.setFont(f1);
seven.setFont(f1);
eight.setFont(f1);
nine.setFont(f1);
one.setForeground(Color.RED);
two.setForeground(Color.blue);
three.setForeground(Color.blue);
four.setForeground(Color.blue);
five.setForeground(Color.blue);
six.setForeground(Color.blue);
seven.setForeground(Color.RED);
eight.setForeground(Color.black);
nine.setForeground(Color.black);
one.setForeground(Color.black);
p.setBackground(Color.yellow);
Icon i = new ImageIcon("xcbj4-013.gif");
Icon ii = new ImageIcon("xcbj4-013.gif");
JLabel llblTop02 = new JLabel(i);
JLabel llblTop = new JLabel(ii);
llblTop.setIcon(i);
llblTop02.setIcon(ii);
gbc.gridx = 0;
gbc.gridy = 0;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.WEST;
gb.setConstraints(llblTop02,gbc);
p.add(llblTop02,gbc);
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.NORTHEAST;
gb.setConstraints(llblTop,gbc);
p.add(llblTop,gbc);
gbc.gridx = 0;
gbc.gridy = 0;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.NORTH;
gb.setConstraints(one,gbc);
p.add(one,gbc);
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.WEST;
gb.setConstraints(two,gbc);
p.add(two,gbc);
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.WEST;
gb.setConstraints(three,gbc);
p.add(three,gbc);
gbc.gridx = 0;
gbc.gridy = 4;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.WEST;
gb.setConstraints(four,gbc);
p.add(four,gbc);
gbc.gridx = 0;
gbc.gridy = 5;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.WEST;
gb.setConstraints(five,gbc);
p.add(five,gbc);
gbc.gridx = 0;
gbc.gridy = 6;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.WEST;
gb.setConstraints(six,gbc);
p.add(six,gbc);
gbc.gridx = 0;
gbc.gridy = 7;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.WEST;
gb.setConstraints(seven,gbc);
p.add(seven,gbc);
gbc.gridx = 0;
gbc.gridy = 8;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.SOUTHEAST;
gb.setConstraints(eight,gbc);
p.add(eight,gbc);
gbc.gridx = 0;
gbc.gridy = 9;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.SOUTHEAST;
gb.setConstraints(nine,gbc);
p.add(nine,gbc);
gbc.gridx = 0;
gbc.gridy = 10;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.anchor = GridBagConstraints.CENTER;
gb.setConstraints(ten,gbc);
p.add(ten,gbc);
ten.addActionListener(this);
//this.setResizable(false);
this.setSize(950,600);
//this.pack();
this.setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
JButton obj= (JButton)e.getSource();
if(e.getSource() == ten)
{
//
// new chatGUI();
this.dispose();
}
}
public static void main(String[] args)
{
new HelpGUI();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -