package a;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.SwingUtilities;
public class Main extends JFrame implements ActionListener {
public JPanel jp() {
JPanel jp = new JPanel(new GridLayout(22, 3));
// String[] s = { "创世记", "出埃及记", "利未记", "民数记", "申命记", "约书亚记", "士师记", "路得记", "撒母耳记上", "撒母耳记下", "列王纪上", "列王纪下",
// "历代志上", "历代志下", "以斯拉记", "尼希米记", "以斯帖记", "约伯记", "诗篇", "箴言", "传道书", "雅歌", "以赛亚书", "耶利米书", "耶利米哀歌", "以西结书",
// "但以理书", "何西阿书", "约珥书", "阿摩司书", "俄巴底亚书", "约拿书", "弥迦书", "那鸿书", "哈巴谷书", "西番雅书", "哈该书", "撒迦利亚书", "玛拉基书",
// "马太福音", "马可福音", "路加福音", "约翰福音", "使徒行传", "罗马书", "哥林多前书", "哥林多后书", "加拉太书", "以弗所书", "腓立比书", "歌罗西书",
// "帖撒罗尼迦前书", "帖撒罗尼迦后书", "提摩太前书", "提摩太后书", "提多书", "腓利门书", "希伯来书", "雅各书", "彼得前书", "彼得后书", "约翰壹书", "约翰贰书",
// "约翰叁书", "犹大书", "启示录" };
String[] s = { "创", "出", "利", "民", "申", "书", "士", "得", "撒上", "撒下", "王上", "王下", "代上", "代下", "拉", "尼", "斯", "伯",
"诗", "箴", "传", "歌", "赛", "耶", "哀", "结", "但", "何", "珥", "摩", "俄", "拿", "弥", "鸿", "哈", "番", "该", "亚", "玛",
"太", "可", "路", "约", "徒", "罗", "林前", "林后", "加", "弗", "腓", "西", "帖前", "帖后", "提前", "提后", "多", "门", "来",
"雅", "彼前", "彼后", "约壹", "约贰", "约叁", "犹", "启" };
JButton[] jb = new JButton[s.length];
for (int i = 0; i < jb.length; i++) {
jb[i] = new JButton(s[i]);
jb[i].addActionListener(this);
if (i < 5) {
jb[i].setBackground(Color.CYAN);
} else if (i < 17) {
jb[i].setBackground(Color.MAGENTA);
} else if (i < 22) {
jb[i].setBackground(Color.YELLOW);
} else if (i < 39) {
jb[i].setBackground(Color.GREEN);
} else if (i < 43) {
jb[i].setBackground(Color.CYAN);
} else if (i < 44) {
jb[i].setBackground(Color.MAGENTA);
} else if (i < 65) {
jb[i].setBackground(Color.YELLOW);
} else if (i < 66) {
jb[i].setBackground(Color.GREEN);
}
jp.add(jb[i]);
}
return jp;
}
public JScrollPane jsp() {
JTextPane jtp = new JTextPane();
JScrollPane jsp = new JScrollPane(jtp);
return jsp;
}
public Main() {
this.add(this.jp(), BorderLayout.WEST);
this.add(this.jsp(), BorderLayout.CENTER);
}
// public JLabel labelUsername() {
// JLabel labelUsername = new JLabel("输入用户名", SwingUtilities.RIGHT);
// labelUsername.setFont(new Font("微软雅黑", Font.BOLD, 50));
// return labelUsername;
// }
//
// public JTextField jtfUsername() {
// JTextField jtfUsername = new JTextField(10);
// jtfUsername.setFont(new Font("微软雅黑", Font.BOLD, 50));
// return jtfUsername;
// }
//
// public JLabel labelPassword() {
// JLabel labelPassword = new JLabel("输入密码", SwingUtilities.RIGHT);
// labelPassword.setFont(new Font("微软雅黑", Font.BOLD, 50));
// return labelPassword;
// }
//
// public JPasswordField jpfPassword() {
// JPasswordField jpfPassword = new JPasswordField();
// jpfPassword.setFont(new Font("微软雅黑", Font.BOLD, 50));
// return jpfPassword;
// }
//
// public JButton jbLogin() {
// JButton jbLogin = new JButton("登录");
// jbLogin.setFont(new Font("微软雅黑", Font.BOLD, 50));
// jbLogin.addActionListener(this);
// return jbLogin;
// }
//
// public JButton jbReg() {
// JButton jbReg = new JButton("注册");
// jbReg.setFont(new Font("微软雅黑", Font.BOLD, 50));
// jbReg.addActionListener(this);
// return jbReg;
// }
//
// public Main() {
// this.setLayout(new GridLayout(3, 2));
// this.add(this.labelUsername());
// this.add(this.jtfUsername());
// this.add(this.labelPassword());
// this.add(this.jpfPassword());
// this.add(this.jbLogin());
// this.add(this.jbReg());
//
// }
public static void main(String[] args) {
Main m = new Main();
m.setBounds(0, 0, 1000, 700);
// m.setExtendedState(JFrame.MAXIMIZED_BOTH);
m.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
m.setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
// String s = ae.getActionCommand();
// if (s.equals("登录")) {
// System.out.println(s);
// BingLiList bll=new BingLiList();
// this.setVisible(false);
// } else if (s.equals("注册")) {
// System.out.println(s);
// }
}
}
左边圣经卷,
最新推荐文章于 2025-11-25 12:11:25 发布
2103

被折叠的 条评论
为什么被折叠?



