@@ -84,17 +84,16 @@ public void actionPerformed(ActionEvent e) {
84
84
85
85
public void newIssue (ActionEvent e ) {
86
86
JDialog jDialog = new JDialog (this , "New Issue" , true );
87
- jDialog .setBounds (0 ,0 ,500 ,500 );
87
+ jDialog .setBounds (0 ,0 ,500 ,700 );
88
88
jDialog .setDefaultCloseOperation (JFrame .DISPOSE_ON_CLOSE );
89
89
jDialog .setLayout (new GridBagLayout ());
90
90
GridBagConstraints gbc = new GridBagConstraints ();
91
91
Insets insets = new Insets (10 , 10 , 10 , 10 );
92
92
gbc .fill = GridBagConstraints .BOTH ;
93
93
gbc .insets = insets ;
94
94
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 );
98
97
gbc .gridx = 0 ;
99
98
gbc .gridy = 0 ;
100
99
gbc .gridwidth = 1 ; // 横占一个单元格
@@ -110,9 +109,28 @@ public void newIssue(ActionEvent e) {
110
109
gbc .weighty = 0.0 ; // 当窗口放大时,高度不变
111
110
jDialog .add (jTextFieldTitle , gbc );
112
111
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 );
116
134
gbc .gridx = 0 ;
117
135
gbc .gridy = 1 ;
118
136
gbc .gridwidth = 1 ; // 横占一个单元格
@@ -127,14 +145,14 @@ public void newIssue(ActionEvent e) {
127
145
gbc .weightx = 0.0 ; // 当窗口放大时,长度不变
128
146
gbc .weighty = 0.0 ; // 当窗口放大时,高度不变
129
147
jDialog .add (jTextAreaBody , gbc );
130
- JButton jButtonSubmit = new JButton ("Submit" );
148
+ JButton jButtonSubmit1 = new JButton ("Submit" );
131
149
gbc .gridx = 1 ;
132
150
gbc .gridy = 2 ;
133
151
gbc .gridwidth = 1 ; // 横占一个单元格
134
152
gbc .gridheight = 1 ; // 列占一个单元格
135
153
gbc .weightx = 0.0 ; // 当窗口放大时,长度不变
136
154
gbc .weighty = 0.0 ; // 当窗口放大时,高度不变
137
- jDialog .add (jButtonSubmit , gbc );
155
+ jDialog .add (jButtonSubmit1 , gbc );
138
156
JDialog jDialog1 = new JDialog (this , "请输入验证码" , true );
139
157
jDialog1 .setLayout (new GridBagLayout ());
140
158
Insets insets1 = new Insets (10 , 10 , 10 , 10 );
@@ -175,7 +193,7 @@ public void newIssue(ActionEvent e) {
175
193
gbc1 .weightx = 0.0 ; // 当窗口放大时,长度不变
176
194
gbc1 .weighty = 0.0 ; // 当窗口放大时,高度不变
177
195
jDialog1 .add (jButton1 , gbc1 );
178
- jButtonSubmit .addActionListener (e1 -> {
196
+ jButtonSubmit1 .addActionListener (e1 -> {
179
197
if (jTextFieldTitle .getText ().equals ("" ) || jTextAreaBody .getText ().equals ("" )) {
180
198
JOptionPane .showMessageDialog (jDialog1 , "Title or Body is empty" );
181
199
return ;
0 commit comments