Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 4fa7727

Browse files
committed
fix some bugs
1 parent 67361a8 commit 4fa7727

File tree

1 file changed

+10
-5
lines changed
  • src/main/java/top/mryan2005/managesysteminjava

1 file changed

+10
-5
lines changed

src/main/java/top/mryan2005/managesysteminjava/Core.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void buildWindows() {
107107
gbc.gridheight = 1; // 列占一个单元格
108108
gbc.weightx = 0.0; // 当窗口放大时,长度不变
109109
gbc.weighty = 0.0; // 当窗口放大时,高度不变
110-
JButton jButtonSearch = new JButton("Search");
110+
JButton jButtonSearch = new JButton("搜索");
111111
jButtonSearch.addActionListener(new ActionListener() {
112112
@Override
113113
public void actionPerformed(ActionEvent e) {
@@ -121,7 +121,7 @@ public void actionPerformed(ActionEvent e) {
121121
gbc.gridheight = 1; // 列占一个单元格
122122
gbc.weightx = 0.0; // 当窗口放大时,长度不变
123123
gbc.weighty = 0.0; // 当窗口放大时,高度不变
124-
JButton jButtonViewAll = new JButton("View All");
124+
JButton jButtonViewAll = new JButton("查看");
125125
jButtonViewAll.addActionListener(new ActionListener() {
126126
@Override
127127
public void actionPerformed(ActionEvent e) {
@@ -1201,6 +1201,10 @@ public void newIssue(ActionEvent e) {
12011201
jButton1.addActionListener(new ActionListener() {
12021202
@Override
12031203
public void actionPerformed(ActionEvent e) {
1204+
if(keyToken.getText().toString().equals("")) {
1205+
JOptionPane.showMessageDialog(jDialog1, "请输入Token");
1206+
return;
1207+
}
12041208
POSTAndGET postAndGet = new POSTAndGET(keyToken.getText().toString());
12051209
postAndGet.newIssue(jTextFieldTitle.getText(), jTextAreaBody.getText(), new String[]{"ReportedBugs"});
12061210
JOptionPane.showMessageDialog(jDialog1, "Issue Submitted");
@@ -1288,7 +1292,7 @@ public void createRegisterWindow(JDialog owner) {
12881292
gbc.gridheight = 1; // 列占一个单元格
12891293
gbc.weightx = 0.0; // 当窗口放大时,长度不变
12901294
gbc.weighty = 0.0; // 当窗口放大时,高度不变
1291-
JTextField jTextFieldPassword = new JTextField("", 20);
1295+
JPasswordField jTextFieldPassword = new JPasswordField("", 20);
12921296
jDialogInput.add(jTextFieldPassword, gbc);
12931297
JLabel jlabelPassword2 = new JLabel("再次输入密码: ");
12941298
jlabelPassword2.setSize(100, 50);
@@ -1301,7 +1305,7 @@ public void createRegisterWindow(JDialog owner) {
13011305
gbc.weightx = 0.0; // 当窗口放大时,长度不变
13021306
gbc.weighty = 0.0; // 当窗口放大时,高度不变
13031307
jDialogInput.add(jlabelPassword2, gbc);
1304-
JTextField jTextFieldPassword2 = new JTextField("", 20);
1308+
JPasswordField jTextFieldPassword2 = new JPasswordField("", 20);
13051309
gbc.fill = GridBagConstraints.BOTH;
13061310
gbc.insets = insets;
13071311
gbc.gridx = 1;
@@ -1355,6 +1359,7 @@ public void actionPerformed(ActionEvent e) {
13551359
JOptionPane.showMessageDialog(jDialogInput, "注册成功!");
13561360
} else {
13571361
JOptionPane.showMessageDialog(jDialogInput, registerResult);
1362+
return;
13581363
}
13591364
isLogin = true;
13601365
jDialogInput.dispose();
@@ -1645,7 +1650,7 @@ public void createSearchWindow() {
16451650
gbc.weightx = 0.0; // 当窗口放大时,长度不变
16461651
gbc.weighty = 0.0; // 当窗口放大时,高度不变
16471652
jDialog.add(jTextField, gbc);
1648-
JButton jButton = new JButton("Search");
1653+
JButton jButton = new JButton("Go");
16491654
gbc.gridx = 0;
16501655
gbc.gridy = 1;
16511656
gbc.gridwidth = 1; // 横占一个单元格

0 commit comments

Comments
 (0)