⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windowstimerwindow.java

📁 Java版本的屏幕截图 工具,可以自己放到系统托盘使用
💻 JAVA
字号:
/* * Copyright (c) 2002-2008 TeamDev Ltd. All rights reserved. * * Use is subject to license terms. * * The complete licence text can be found at * http://www.teamdev.com/winpack/license.jsf */package teamdev.jxcapture.samples.demo.timer;import teamdev.jxdesktop.win32.ui.Wnd;import javax.swing.*;import java.util.TimerTask;/** * Windows OS platform specific implementation of Timer window * that notifies how many seconds left before capture. * * @author slavapak */public class WindowsTimerWindow extends TimerWindow {    private Wnd dialogWindow;    public WindowsTimerWindow(JWindow window) {        dialogWindow = new Wnd(window);        dialogWindow.setTopmost(true);        dialogWindow.setTransparent((byte) 1);    }    public void showWithFadeEffect() {        final int[] transparency = new int[]{25};        final boolean[] completed = new boolean[]{false};        new java.util.Timer().schedule(new TimerTask() {            public void run() {                dialogWindow.setTransparent((byte) (transparency[0] += 10));                if (transparency[0] > 256) {                    dialogWindow.setTransparent(false);                    completed[0] = true;                    cancel();                }            }        }, 0, 25);        // wait until dialog is shown completely        while (!completed[0]) {            try {                Thread.sleep(50);            } catch (InterruptedException e) {                // @ignore            }        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -