📄 windowstimerwindow.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 + -