From 52a99a220a1c8fb2ecb7afc3c1948109ce3148b5 Mon Sep 17 00:00:00 2001 From: JianGuo Date: Fri, 14 Jun 2024 13:50:16 +0800 Subject: [PATCH] =?UTF-8?q?1.=E9=99=8D=E7=BA=A7=E5=88=B0jdk1.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FileTransferClient/pom.xml | 3 +-- .../src/main/java/com/xiaoliu/window/MainWindow.java | 11 ++++++----- FileTransferCommon/pom.xml | 2 +- FileTransferService/pom.xml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/FileTransferClient/pom.xml b/FileTransferClient/pom.xml index 1e1f7fb..ad61382 100644 --- a/FileTransferClient/pom.xml +++ b/FileTransferClient/pom.xml @@ -15,7 +15,7 @@ UTF-8 - 21 + 1.8 @@ -28,7 +28,6 @@ com.formdev flatlaf 3.4.1 - no-natives diff --git a/FileTransferClient/src/main/java/com/xiaoliu/window/MainWindow.java b/FileTransferClient/src/main/java/com/xiaoliu/window/MainWindow.java index 30e79bb..2df1646 100644 --- a/FileTransferClient/src/main/java/com/xiaoliu/window/MainWindow.java +++ b/FileTransferClient/src/main/java/com/xiaoliu/window/MainWindow.java @@ -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); diff --git a/FileTransferCommon/pom.xml b/FileTransferCommon/pom.xml index 7bdc311..6c720e8 100644 --- a/FileTransferCommon/pom.xml +++ b/FileTransferCommon/pom.xml @@ -15,7 +15,7 @@ UTF-8 - 21 + 1.8 diff --git a/FileTransferService/pom.xml b/FileTransferService/pom.xml index 21a39ab..639ebb2 100644 --- a/FileTransferService/pom.xml +++ b/FileTransferService/pom.xml @@ -15,7 +15,7 @@ UTF-8 - 21 + 1.8