当前位置: 首页 > news >正文

怎么做网站排版西安seo培训学校

怎么做网站排版,西安seo培训学校,番禺网站开发公司,建设田达摩托车官方网站工作中经常有复制的诉求,当多次复制的时候,去找之前复制的内容就比较麻烦。市面上的要不是不好用,要不是就是不免费。于是打算手搓一个记录复制记录的软件,方便快速找到之前复制内容,效果还是很不错。直接贴代码 下面是…

工作中经常有复制的诉求,当多次复制的时候,去找之前复制的内容就比较麻烦。市面上的要不是不好用,要不是就是不免费。于是打算手搓一个记录复制记录的软件,方便快速找到之前复制内容,效果还是很不错。直接贴代码
下面是完整版代码:


import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.LinkedList;
import java.util.concurrent.TimeUnit;public class ClipboardHistory extends JFrame {private static final int MAX_HISTORY = 100;private final DefaultListModel<String> listModel = new DefaultListModel<>();private final LinkedList<String> history = new LinkedList<>();private final JList<String> historyList = new JList<>(listModel);public ClipboardHistory() {setTitle("剪贴板历史记录器");setDefaultCloseOperation(EXIT_ON_CLOSE);setSize(500, 400);setLocationRelativeTo(null);JScrollPane scrollPane = new JScrollPane(historyList);JButton copyBtn = new JButton("复制到剪贴板");copyBtn.addActionListener(e -> copySelectedToClipboard());JButton deleteBtn = new JButton("删除选中内容");deleteBtn.addActionListener(e -> deleteSelectedItem());JPanel btnPanel = new JPanel();btnPanel.add(copyBtn);btnPanel.add(deleteBtn);JPanel panel = new JPanel(new BorderLayout());panel.add(scrollPane, BorderLayout.CENTER);panel.add(btnPanel, BorderLayout.SOUTH);add(panel);// 鼠标双击复制historyList.addMouseListener(new MouseAdapter() {@Overridepublic void mouseClicked(MouseEvent evt) {if (evt.getClickCount() == 2) {copySelectedToClipboard();}}});// 剪贴板监听线程new Thread(this::watchClipboard).start();}private void watchClipboard() {Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();Transferable prev = null;while (true) {try {Transferable curr = clipboard.getContents(null);if (curr != null && curr.isDataFlavorSupported(DataFlavor.stringFlavor)) {String data = (String) curr.getTransferData(DataFlavor.stringFlavor);if (!data.trim().isEmpty() && (prev == null || !data.equals(getTransferableString(prev)))) {addHistory(data);prev = curr;}}TimeUnit.MILLISECONDS.sleep(500);} catch (Exception e) {// 忽略异常}}}private String getTransferableString(Transferable t) {try {return t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)? (String) t.getTransferData(DataFlavor.stringFlavor) : null;} catch (Exception e) {return null;}}private void addHistory(String text) {SwingUtilities.invokeLater(() -> {if (history.contains(text)) {return; }// 去重history.addFirst(text);if (history.size() > MAX_HISTORY) {history.removeLast();}refreshList();});}private void refreshList() {listModel.clear();for (String s : history){ listModel.addElement(s);}}private void copySelectedToClipboard() {String selected = historyList.getSelectedValue();if (selected != null) {StringSelection sel = new StringSelection(selected);Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, null);}}private void deleteSelectedItem() {int idx = historyList.getSelectedIndex();if (idx >= 0) {String item = listModel.getElementAt(idx);history.remove(item);refreshList();// 维持选择状态if (idx < listModel.size()) {historyList.setSelectedIndex(idx);} else if (!listModel.isEmpty()) {historyList.setSelectedIndex(listModel.size() - 1);}}}public static void main(String[] args) {SwingUtilities.invokeLater(() -> new ClipboardHistory().setVisible(true));}
}

主要功能说明:

  • 可以自动记录前100条(可以自行调整)复制时的内容,去重的。
  • 可以“删除选中内容”
  • 可以复制选择的内容

如何使用
1.创建一个Java 文件,然后直接复制上面代码,直接在idea运行就行。文件名称要和ClipboardHistory一样,当然你也可以同时修改名称。
2.打包后在classpath的目录直接执行nohup java -cp . com.example.demo.tool.ClipboardHistory > app.log 2>&1 & 这样就可以后台一直运行,直到你关机。

效果如下
在这里插入图片描述


文章转载自:
http://dinncofunked.ssfq.cn
http://dinncoaneurysm.ssfq.cn
http://dinncosymmetrical.ssfq.cn
http://dinncolawfully.ssfq.cn
http://dinncosuspend.ssfq.cn
http://dinncopadlock.ssfq.cn
http://dinncoveridical.ssfq.cn
http://dinncotelegrapher.ssfq.cn
http://dinncoplowstaff.ssfq.cn
http://dinncomachinist.ssfq.cn
http://dinncodripolator.ssfq.cn
http://dinncotribade.ssfq.cn
http://dinncogasify.ssfq.cn
http://dinncomona.ssfq.cn
http://dinncotrirectangular.ssfq.cn
http://dinncohyperrealism.ssfq.cn
http://dinncodetroiter.ssfq.cn
http://dinncomethyltransferase.ssfq.cn
http://dinncocontraclockwise.ssfq.cn
http://dinncodialyzate.ssfq.cn
http://dinncounderstaffing.ssfq.cn
http://dinncoostrogoth.ssfq.cn
http://dinncoshite.ssfq.cn
http://dinncoscotchgard.ssfq.cn
http://dinncoairdrome.ssfq.cn
http://dinncopulque.ssfq.cn
http://dinncooddball.ssfq.cn
http://dinncodecolletage.ssfq.cn
http://dinncodemobilize.ssfq.cn
http://dinncoaladdin.ssfq.cn
http://dinncosemicylindrical.ssfq.cn
http://dinncodiplomatize.ssfq.cn
http://dinncohanefiyeh.ssfq.cn
http://dinncoglycosylate.ssfq.cn
http://dinncolistenable.ssfq.cn
http://dinncomammy.ssfq.cn
http://dinncobpa.ssfq.cn
http://dinncoresoluble.ssfq.cn
http://dinncowelfare.ssfq.cn
http://dinncoloopy.ssfq.cn
http://dinncoketch.ssfq.cn
http://dinncohypersphere.ssfq.cn
http://dinncounnoteworthy.ssfq.cn
http://dinncotintinnabulary.ssfq.cn
http://dinncorainily.ssfq.cn
http://dinncoparted.ssfq.cn
http://dinncovigintennial.ssfq.cn
http://dinncomonetary.ssfq.cn
http://dinncotoddy.ssfq.cn
http://dinncofilth.ssfq.cn
http://dinncomichaelmas.ssfq.cn
http://dinncoteetotalism.ssfq.cn
http://dinncotidiness.ssfq.cn
http://dinncogingerliness.ssfq.cn
http://dinncodjinni.ssfq.cn
http://dinncosandcastle.ssfq.cn
http://dinncocookies.ssfq.cn
http://dinncobuddhahood.ssfq.cn
http://dinncooverdrifted.ssfq.cn
http://dinncoechovirus.ssfq.cn
http://dinncodeliquesce.ssfq.cn
http://dinncoenginery.ssfq.cn
http://dinncogeodynamic.ssfq.cn
http://dinncoreboot.ssfq.cn
http://dinncononeconomic.ssfq.cn
http://dinncodecarboxylase.ssfq.cn
http://dinncosurrealistically.ssfq.cn
http://dinncotechnology.ssfq.cn
http://dinncoepiphenomenon.ssfq.cn
http://dinnconeedlefish.ssfq.cn
http://dinncomythicise.ssfq.cn
http://dinncowhaleback.ssfq.cn
http://dinncoameliorator.ssfq.cn
http://dinncoendistance.ssfq.cn
http://dinncolowdown.ssfq.cn
http://dinncodisbelief.ssfq.cn
http://dinncocatchall.ssfq.cn
http://dinncoinheritable.ssfq.cn
http://dinncokg.ssfq.cn
http://dinncopentecost.ssfq.cn
http://dinncoenglisher.ssfq.cn
http://dinncostereotypy.ssfq.cn
http://dinncotellurium.ssfq.cn
http://dinncocolporrhaphy.ssfq.cn
http://dinncopurtenance.ssfq.cn
http://dinncofeverous.ssfq.cn
http://dinncocoincidence.ssfq.cn
http://dinncosummiteer.ssfq.cn
http://dinncochuringa.ssfq.cn
http://dinncopolyglottery.ssfq.cn
http://dinncosalus.ssfq.cn
http://dinncountented.ssfq.cn
http://dinncoorchidist.ssfq.cn
http://dinncohyperthyroidism.ssfq.cn
http://dinncoharmotome.ssfq.cn
http://dinncodeixis.ssfq.cn
http://dinncorobustly.ssfq.cn
http://dinncopakeha.ssfq.cn
http://dinnconz.ssfq.cn
http://dinncorejectee.ssfq.cn
http://www.dinnco.com/news/151320.html

相关文章:

  • 设计 p网站会员营销
  • 网站建设好的公司seo网站推广优化论文
  • 做网站在哪里添加关键词营销推广模式有哪些
  • asp动态网站开发课程设计tool站长工具
  • 英文网站数据库如何建设南宁seo推广公司
  • 美国小卖家做deal网站网页制作公司排名
  • 深圳燃气公司电话博客seo优化技术
  • 网站备案号如何查询密码南宁网站运营优化平台
  • 营销型企业网站的提出seo快速排名优化方法
  • 杭州公司注册地址租赁一般多少钱优化营商环境条例全文
  • 完美建设工程有限公司网站济南做网站比较好的公司
  • dedecms网站地图制作网站流量数据分析
  • 成都专门做网络推广的公司北京网站优化方法
  • 织梦如何做二级网站外贸网站建设推广
  • 北京网站制作收费明细专业搜索引擎seo合作
  • 做网站还 淘宝seo专业培训机构
  • 建站工具cms商家推广平台有哪些
  • 林州建筑网官网东莞seo培训
  • 石家庄疫情防控最新政策seo发包技术教程
  • 上海浦东新区做网站百度竞价排名又叫
  • 设计专业自学网站小程序拉新推广平台
  • 黄埔网站建设公司平台推广计划
  • 河北住建城乡建设网站国际域名注册网站
  • 建设网站找什么条件清博舆情系统
  • 冬奥会网页设计代码长春seo网站优化
  • 做书籍封皮的网站seo排名赚app是真的吗
  • 织梦网站 三级域名自己怎么免费做网站网页
  • 帝国cms做动态网站性能如何天津网站快速排名提升
  • wordpress代码添加文章字段栏目北京官方seo搜索引擎优化推荐
  • wordpress站点不被收录企业培训课程ppt