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

Commit 3d077c4

Browse files
committed
fix some bugs
1 parent ece5c80 commit 3d077c4

File tree

1 file changed

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

1 file changed

+28
-10
lines changed

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

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,16 @@ public void actionPerformed(ActionEvent e) {
8484

8585
public void newIssue(ActionEvent e) {
8686
JDialog jDialog = new JDialog(this, "New Issue", true);
87-
jDialog.setBounds(0,0,500,500);
87+
jDialog.setBounds(0,0,500,700);
8888
jDialog.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
8989
jDialog.setLayout(new GridBagLayout());
9090
GridBagConstraints gbc = new GridBagConstraints();
9191
Insets insets = new Insets(10, 10, 10, 10);
9292
gbc.fill = GridBagConstraints.BOTH;
9393
gbc.insets = insets;
9494
JLabel jLabel = new JLabel("Title");
95-
JTextField jTextFieldTitle = new JTextField("", 20);
96-
jTextFieldTitle.setSize(100, 50);
97-
jTextFieldTitle.setColumns(20);
95+
JTextField jTextFieldTitle = new JTextField("");
96+
jTextFieldTitle.setColumns(30);
9897
gbc.gridx = 0;
9998
gbc.gridy = 0;
10099
gbc.gridwidth = 1; // 横占一个单元格
@@ -110,9 +109,28 @@ public void newIssue(ActionEvent e) {
110109
gbc.weighty = 0.0; // 当窗口放大时,高度不变
111110
jDialog.add(jTextFieldTitle, gbc);
112111
JLabel jLabel2 = new JLabel("Body");
113-
JTextArea jTextAreaBody = new JTextArea(20, 20);
114-
jTextAreaBody.setSize(100, 50);
115-
jTextAreaBody.setColumns(20);
112+
TextArea jTextAreaBody = new TextArea("**Describe the bug**\n" +
113+
"A clear and concise description of what the bug is.\n" +
114+
"\n" +
115+
"**To Reproduce**\n" +
116+
"Steps to reproduce the behavior:\n" +
117+
"1. Go to '...'\n" +
118+
"2. Click on '....'\n" +
119+
"3. Scroll down to '....'\n" +
120+
"4. See error\n" +
121+
"\n" +
122+
"**Expected behavior**\n" +
123+
"A clear and concise description of what you expected to happen.\n" +
124+
"\n" +
125+
"**Screenshots**\n" +
126+
"If applicable, add screenshots to help explain your problem.\n" +
127+
"\n" +
128+
"**Desktop (please complete the following information):**\n" +
129+
" - OS: [e.g. iOS]\n" +
130+
" - Version [e.g. 22]\n" +
131+
"\n" +
132+
"**Additional context**\n" +
133+
"Add any other context about the problem here.\n", 30, 30, TextArea.SCROLLBARS_VERTICAL_ONLY);
116134
gbc.gridx = 0;
117135
gbc.gridy = 1;
118136
gbc.gridwidth = 1; // 横占一个单元格
@@ -127,14 +145,14 @@ public void newIssue(ActionEvent e) {
127145
gbc.weightx = 0.0; // 当窗口放大时,长度不变
128146
gbc.weighty = 0.0; // 当窗口放大时,高度不变
129147
jDialog.add(jTextAreaBody, gbc);
130-
JButton jButtonSubmit = new JButton("Submit");
148+
JButton jButtonSubmit1 = new JButton("Submit");
131149
gbc.gridx = 1;
132150
gbc.gridy = 2;
133151
gbc.gridwidth = 1; // 横占一个单元格
134152
gbc.gridheight = 1; // 列占一个单元格
135153
gbc.weightx = 0.0; // 当窗口放大时,长度不变
136154
gbc.weighty = 0.0; // 当窗口放大时,高度不变
137-
jDialog.add(jButtonSubmit, gbc);
155+
jDialog.add(jButtonSubmit1, gbc);
138156
JDialog jDialog1 = new JDialog(this, "请输入验证码", true);
139157
jDialog1.setLayout(new GridBagLayout());
140158
Insets insets1 = new Insets(10, 10, 10, 10);
@@ -175,7 +193,7 @@ public void newIssue(ActionEvent e) {
175193
gbc1.weightx = 0.0; // 当窗口放大时,长度不变
176194
gbc1.weighty = 0.0; // 当窗口放大时,高度不变
177195
jDialog1.add(jButton1, gbc1);
178-
jButtonSubmit.addActionListener(e1 -> {
196+
jButtonSubmit1.addActionListener(e1 -> {
179197
if (jTextFieldTitle.getText().equals("") || jTextAreaBody.getText().equals("")) {
180198
JOptionPane.showMessageDialog(jDialog1, "Title or Body is empty");
181199
return;

0 commit comments

Comments
 (0)