1.降级到jdk1.8
This commit is contained in:
parent
f1eb943f08
commit
52a99a220a
|
@ -15,7 +15,7 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.java.version>21</project.java.version>
|
||||
<project.java.version>1.8</project.java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -28,7 +28,6 @@
|
|||
<groupId>com.formdev</groupId>
|
||||
<artifactId>flatlaf</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<classifier>no-natives</classifier>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -63,8 +63,8 @@ public class MainWindow extends JFrame {
|
|||
|
||||
// 将JScrollPane添加到窗口中
|
||||
getContentPane().add(scrollPane, BorderLayout.CENTER);
|
||||
JLabel adress = new JLabel();
|
||||
adress.setText("地址:");
|
||||
JLabel address = new JLabel();
|
||||
address.setText("地址:");
|
||||
JTextField textField = new JTextField(20); // 参数20指定了文本框的列数
|
||||
JButton sendButton = new JButton("连接");
|
||||
JButton stopButton = new JButton("断开");
|
||||
|
@ -88,16 +88,17 @@ public class MainWindow extends JFrame {
|
|||
stopButton.setEnabled(true);
|
||||
Client.init(host, Integer.parseInt(port));
|
||||
} catch (Exception ex) {
|
||||
setLogText("连接失败...");
|
||||
sendButton.setEnabled(true);
|
||||
stopButton.setEnabled(false);
|
||||
setStatusLabel("已连接", Color.RED);
|
||||
setStatusLabel("未连接", Color.RED);
|
||||
JOptionPane.showMessageDialog(this, "连接失败,请检查...", "连接", JOptionPane.ERROR_MESSAGE);
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}).start();
|
||||
});
|
||||
|
||||
JPanel northPanel = new JPanel();
|
||||
northPanel.add(adress);
|
||||
northPanel.add(address);
|
||||
northPanel.add(textField);
|
||||
northPanel.add(sendButton);
|
||||
northPanel.add(statusLabel, BorderLayout.WEST);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.java.version>21</project.java.version>
|
||||
<project.java.version>1.8</project.java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.java.version>21</project.java.version>
|
||||
<project.java.version>1.8</project.java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
Loading…
Reference in New Issue