資源簡介
使用java代碼制作錄屏功能,包括開始,暫停,繼續,播放,退出等功能

代碼片段和文件信息
package?com.xhz;
import?java.awt.AWTException;
import?java.awt.Color;
import?java.awt.Dimension;
import?java.awt.Font;
import?java.awt.Graphics;
import?java.awt.GridLayout;
import?java.awt.MouseInfo;
import?java.awt.Point;
import?java.awt.Rectangle;
import?java.awt.Robot;
import?java.awt.Toolkit;
import?java.awt.event.ActionEvent;
import?java.awt.event.ActionListener;
import?java.awt.event.KeyAdapter;
import?java.awt.event.KeyEvent;
import?java.awt.event.MouseAdapter;
import?java.awt.event.MouseEvent;
import?java.awt.event.MouseListener;
import?java.awt.image.BufferedImage;
import?java.io.ByteArrayInputStream;
import?java.io.ByteArrayOutputStream;
import?java.io.Closeable;
import?java.io.File;
import?java.io.IOException;
import?java.io.RandomAccessFile;
import?java.nio.ByteBuffer;
import?java.nio.MappedByteBuffer;
import?java.nio.channels.FileChannel;
import?java.nio.channels.FileChannel.MapMode;
import?java.util.ArrayList;
import?java.util.Arrays;
import?java.util.List;
import?java.util.concurrent.BlockingQueue;
import?java.util.concurrent.ExecutorService;
import?java.util.concurrent.Executors;
import?java.util.concurrent.linkedBlockingQueue;
import?java.util.concurrent.ScheduledExecutorService;
import?java.util.concurrent.TimeUnit;
import?java.util.zip.ZipEntry;
import?java.util.zip.ZipInputStream;
import?java.util.zip.ZipOutputStream;
import?javax.imageio.ImageIO;
import?javax.sound.sampled.AudioFormat;
import?javax.sound.sampled.AudioSystem;
import?javax.sound.sampled.DataLine;
import?javax.sound.sampled.SourceDataLine;
import?javax.sound.sampled.TargetDataLine;
import?javax.swing.JButton;
import?javax.swing.Jframe;
import?javax.swing.JPanel;
import?javax.swing.event.ChangeEvent;
import?javax.swing.event.ChangeListener;
/**
?*?java錄像小程序:?視頻文件保存在系統臨時目錄?回車全屏播放?ESC退出全屏播放
?*?
?*?@author?xhz
?*?
?*/
@SuppressWarnings(“serial“)
public?class?Mainframe?extends?Jframe?{
private?static?final?int?WIDTH?=?200;
private?static?final?int?HEIGHT?=?70;
private?static?final?Color?BUTTON_COLOR?=?new?Color(155?183?214);
private?static?final?Color?BUTTON_FOCUS_COLOR?=?new?Color(87?156?242);
private?static?final?Color?BUTTON_DISABLE_COLOR?=?new?Color(180?207?229);
private?static?final?Font?BUTTON_FONT?=?new?Font(“華文行楷“?Font.BOLD?15);
private?static?final?String?DEFAULT_FILE_PATH?=?System
.getProperty(“java.io.tmpdir“);
private?static?Dimension?screenSize;
private?final?JButton?start?=?new?JButton(“開始“);
private?final?JButton?pause?=?new?JButton(“暫停“);
private?final?JButton?restart?=?new?JButton(“繼續“);
private?final?JButton?stop?=?new?JButton(“完成“);
private?final?JButton?play?=?new?JButton(“播放“);
private?final?JButton?close?=?new?JButton(“退出“);
private?String?currentFilePath;
public?Mainframe()?{
setUndecorated(true);
setSize(WIDTH?HEIGHT);
Toolkit?tk?=?Toolkit.getDefaultToolkit();
screenSize?=?tk.getScreenSize();
setLocation(
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-03-02?08:53??Video\
?????文件????????1093??2018-03-02?08:53??Video\.classpath
?????文件????????1330??2018-03-14?10:39??Video\.project
?????目錄???????????0??2018-03-02?08:53??Video\.settings\
?????文件?????????522??2018-03-02?08:53??Video\.settings\.jsdtscope
?????文件?????????364??2018-03-02?08:53??Video\.settings\org.eclipse.jdt.core.prefs
?????文件?????????474??2018-03-02?08:53??Video\.settings\org.eclipse.wst.common.component
?????文件?????????414??2018-03-02?08:53??Video\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2018-03-02?08:53??Video\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2018-03-02?08:53??Video\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2018-03-02?08:54??Video\src\
?????目錄???????????0??2018-03-02?09:19??Video\src\com\
?????目錄???????????0??2018-03-02?08:54??Video\src\com\xhz\
?????文件???????31446??2018-03-02?10:34??Video\src\com\xhz\Mainfr
?????目錄???????????0??2018-03-02?08:53??Video\WebRoot\
?????文件?????????834??2018-03-02?08:53??Video\WebRoot\index.jsp
?????目錄???????????0??2018-03-02?08:53??Video\WebRoot\me
?????文件??????????39??2018-03-02?08:53??Video\WebRoot\me
?????目錄???????????0??2018-03-02?08:53??Video\WebRoot\WEB-INF\
?????目錄???????????0??2018-03-02?08:54??Video\WebRoot\WEB-INF\classes\
?????目錄???????????0??2018-03-02?09:19??Video\WebRoot\WEB-INF\classes\com\
?????目錄???????????0??2018-03-02?08:55??Video\WebRoot\WEB-INF\classes\com\xhz\
?????文件????????2324??2018-03-02?10:34??Video\WebRoot\WEB-INF\classes\com\xhz\AudioHelper.class
?????文件????????6253??2018-03-02?10:34??Video\WebRoot\WEB-INF\classes\com\xhz\ImageHelper.class
?????文件????????1080??2018-03-02?10:34??Video\WebRoot\WEB-INF\classes\com\xhz\Mainfr
?????文件????????1001??2018-03-02?10:34??Video\WebRoot\WEB-INF\classes\com\xhz\Mainfr
?????文件????????1418??2018-03-02?10:34??Video\WebRoot\WEB-INF\classes\com\xhz\Mainfr
?????文件?????????888??2018-03-02?10:34??Video\WebRoot\WEB-INF\classes\com\xhz\Mainfr
?????文件?????????890??2018-03-02?10:34??Video\WebRoot\WEB-INF\classes\com\xhz\Mainfr
?????文件?????????922??2018-03-02?10:34??Video\WebRoot\WEB-INF\classes\com\xhz\Mainfr
?????文件?????????751??2018-03-02?10:34??Video\WebRoot\WEB-INF\classes\com\xhz\Mainfr
............此處省略19個文件信息
- 上一篇:Java學習路徑.pdf
- 下一篇:Jpcap.dll_64x_32x,及。jar包
評論
共有 條評論