From e47c339091f5351eb24a8ff0aefc3c46be516c45 Mon Sep 17 00:00:00 2001 From: renfei Date: Tue, 24 Sep 2024 11:15:57 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20swing=E6=89=93=E5=8C=85=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../java/net/renfei/indexing/Application.java | 2 +- .../net/renfei/indexing/ui/MainWindow.java | 61 +++++++++++-------- 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index 877b842..6f4175a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.renfei Indexing - 1.0.3 + 1.0.4 Indexing https://www.renfei.net/kitbox/indexing Indexing - 搜索引擎推送工具 - SEO 工具箱 diff --git a/src/main/java/net/renfei/indexing/Application.java b/src/main/java/net/renfei/indexing/Application.java index 31d27be..e655788 100644 --- a/src/main/java/net/renfei/indexing/Application.java +++ b/src/main/java/net/renfei/indexing/Application.java @@ -13,7 +13,7 @@ */ public class Application { public static final MainWindow MAIN_WINDOW = new MainWindow(); - public static final String VERSION = "1.0.3"; + public static final String VERSION = "1.0.4"; public static void main(String[] args) { javax.swing.JFrame frame = new javax.swing.JFrame("Indexing - 搜索引擎推送工具 - SEO 工具箱"); frame.setContentPane(MAIN_WINDOW.mainPanel); diff --git a/src/main/java/net/renfei/indexing/ui/MainWindow.java b/src/main/java/net/renfei/indexing/ui/MainWindow.java index 48eefd2..2a8c7c6 100644 --- a/src/main/java/net/renfei/indexing/ui/MainWindow.java +++ b/src/main/java/net/renfei/indexing/ui/MainWindow.java @@ -50,35 +50,44 @@ public void init() { urlsScroPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); logsScroPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); MainWindow mainWindow = this; - execButton.addActionListener(e -> { - setLog("开始执行"); - Thread execService = new Thread(new ExecService(mainWindow), "ExecService"); - execService.start(); + execButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + setLog("开始执行"); + Thread execService = new Thread(new ExecService(mainWindow), "ExecService"); + execService.start(); + } }); - googleJson.addActionListener(e -> { - JFileChooser fc = new JFileChooser("/"); - int val = fc.showOpenDialog(null); - if (val == JFileChooser.APPROVE_OPTION) { - googleJson.setText(fc.getSelectedFile().getPath()); - } else { - googleJson.setText("点击选择JSON文件"); + googleJson.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + JFileChooser fc = new JFileChooser("/"); + int val = fc.showOpenDialog(null); + if (val == JFileChooser.APPROVE_OPTION) { + googleJson.setText(fc.getSelectedFile().getPath()); + } else { + googleJson.setText("点击选择JSON文件"); + } } }); - extractSitemapButtonButton.addActionListener(e -> { - int opt = JOptionPane.showConfirmDialog(extractSitemapButtonButton, - "点击确认将从网站地图文件(sitemap.xml)中提取链接,但是请注意:\n\n" + - "Indexing 接口的本意是:新内容产生时,及时通知搜索引擎爬取,确保新内容的及时收录。\n" + - "网站地图包含了全站连接,其中包括陈旧的内容,所以会产生以下问题:\n\n" + - "1.Indexing 接口滥用,因为提交的并不是新产生的内容,包含大量陈旧可能违反搜索引擎的用户使用协议,可能导致接口权限被收回\n" + - "2.全站链接数量过大,部分接口每天每月有使用限额,一口气提交会导致接口使用额度耗尽\n\n" + - "请知晓以上说明,自行合理的使用 API。", - "从站点地图中提取链接", - JOptionPane.YES_NO_OPTION, WARNING_MESSAGE); - if (opt == JOptionPane.YES_OPTION) { - //确认继续操作 - setLog("从站点地图中提取链接"); - Thread execService = new Thread(new ExtractSitemapService(mainWindow), "ExtractSitemapService"); - execService.start(); + extractSitemapButtonButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + int opt = JOptionPane.showConfirmDialog(extractSitemapButtonButton, + "点击确认将从网站地图文件(sitemap.xml)中提取链接,但是请注意:\n\n" + + "Indexing 接口的本意是:新内容产生时,及时通知搜索引擎爬取,确保新内容的及时收录。\n" + + "网站地图包含了全站连接,其中包括陈旧的内容,所以会产生以下问题:\n\n" + + "1.Indexing 接口滥用,因为提交的并不是新产生的内容,包含大量陈旧可能违反搜索引擎的用户使用协议,可能导致接口权限被收回\n" + + "2.全站链接数量过大,部分接口每天每月有使用限额,一口气提交会导致接口使用额度耗尽\n\n" + + "请知晓以上说明,自行合理的使用 API。", + "从站点地图中提取链接", + JOptionPane.YES_NO_OPTION, WARNING_MESSAGE); + if (opt == JOptionPane.YES_OPTION) { + //确认继续操作 + setLog("从站点地图中提取链接"); + Thread execService = new Thread(new ExtractSitemapService(mainWindow), "ExtractSitemapService"); + execService.start(); + } } }); ConfigVO configVO = ConfigFileService.getConfig();