目录

我的学习分享

记录精彩的程序人生

【Netbeans Platform】Attach source code to a Netbeans Library Wrapper Module

Attach source code to a Netbeans Library Wrapper Module I’m new in NetBeans and today I’ve been struggling a couple of hours with the simple task of attaching the source code for an external JAR (NetBean Library Wrapper Module). I’ve been trying to find in google how to do it without success until I reached this post in the netbeans-users mailing list. Then I realized that I should been looking into the NetBeans Help first. The entry at Help -> Help contents -> Java Applications -> Deb....

【Netbeans Platform】关于Native Library在NetbeansRCP应用中的设置 有更新!

在Netbeans RCP中利用JMF框架实现音频视频的传输,开始就遇到一个问题,网上搜索了一下,与下面这个类似,直接贴过来吧 http://stackoverflow.com/questions/5887383/netbeans-platform-application-doesnt-detect-webcam-devices-with-jmf I've been trying to develop an application with Netbeans RCP to grab images from a webcam. Plain and simple, it works in a regular Java project. So first of all the JMF must be installed (I'm on Windows 7 64bit, (32bit JDK which is needed for JMF). In a regular Java project I have the following code: Vector webcams = Captu....

【Netbeans Platform】NetBeans Lookups Explained!

Lookups are one of the most important parts of the NetBeans Platform. They're used almost everywhere and most of the time when you ask something on a mailing list the answer is "Use Lookups!". Many times when the use of Lookups is explained it's in a very specific context, e.g. selection management or ServiceLoaders. That makes Lookups look complicated and hard to understand, while actually they are very simple and extremely powerful. That's why I guess it's time to write an article that explain....

【Netbeans Platform】netbeans rcp中如何编程设置主窗口标题

// 设置主窗口标题 WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { WindowManager.getDefault().getMainWindow().setTitle("xxx系统"); } });

【Java基础】Maven的Scope区别笔记 有更新!

依赖的Scope scope定义了类包在项目的使用阶段。项目阶段包括: 编译,运行,测试和发布。 分类说明 compile 默认scope为compile,表示为当前依赖参与项目的编译、测试和运行阶段,属于强依赖。打包之时,会达到包里去。 test 该依赖仅仅参与测试相关的内容,包括测试用例的编译和执行,比如定性的Junit。 runtime 依赖仅参与运行周期中的使用。一般这种类库都是接口与实现相分离的类库,比如JDBC类库,在编译之时仅依赖相关的接口,在具体的运行之时,才需要具体的mysql、oracle等等数据的驱动程序。 此类的驱动都是为runtime的类库。 provided 该依赖在打包过程中,不需要打进去,这个由运行的环境来提供,比如tomcat或者基础类库等等,事实上,该依赖可以参与编译、测试和运行等周期,与compile等同。区别在于打包阶段进行了exclude操作。 system 使用上与provided相同,不同之处在于该依赖不从maven仓库中提取,而是从本地文件系统中提取,其会参照systemPath的属性进行提取依赖。 import 这个是mave....

【Java基础】Java InputStream转File

文件处于磁盘上或者流处于内存中 在输入流有已知的和预处理的数据时,如在硬盘上的文件或者在流处于内存中。这种情况下,不需要做边界校验,并且内存容量条件允许的话,可以简单的读取并一次写入。 InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt")); byte[] buffer = new byte[initialStream.available()]; initialStream.read(buffer); File targetFile = new File("src/main/resources/targetFile.tmp"); OutputStream outStream = new FileOutputStream(targetFile); outStream.write(buffer); 基于Guava的实现 InputStream initialStream = new FileInputStream(new File("src/main/resour....

【Netbeans Platform】关于Native Library在NetbeansRCP应用中的设置 有更新!

https://www.cnblogs.com/cuizhf/archive/2011/11/02/2232807.html

【Java基础】Java压缩解压ZIP之Zip4j

Zip4j是一个Java操作zip压缩格式的开源项目,功能强大而且使用方便,能完全满足Java操作Zip压缩文件。默认采用UTF-8编码,所以支持中文,同时也支持密码,而且支持多种压缩算法。Zt-ZIP也不错,有兴趣的可以试试。 http://www.lingala.net/zip4j/ 压缩 1、文件压缩 ZipFile zipFile = new ZipFile("c:\\ZipTest\\test1.zip"); ArrayList filesToAdd = new ArrayList(); filesToAdd.add(new File("c:\\ZipTest\\sample.txt")); filesToAdd.add(new File("c:\\ZipTest\\文件.doc")); filesToAdd.add(new File("c:\\ZipTest\\파일.xls")); filesToAdd.add(new File("c:\\ZipTest\\ファイル.ppt")); ZipParameters parameters = new ZipParameters(....

【git】git设置忽略文件.gitignore

在仓库目录下新建一个名为.gitignore的文件(因为是点开头,没有文件名,没办法直接在windows目录下直接创建,必须通过右键Git Bash,按照linux的方式来新建.gitignore文件)。如下图所示。 .gitignore文件对其所在的目录及所在目录的全部子目录均有效。通过将.gitignore文件添加到仓库,其他开发者更新该文件到本地仓库,以共享同一套忽略规则。 以下涉及的ignore文件均为如下格式: # 以'#'开始的行,被视为注释. # 忽略掉所有文件名是 foo.txt的文件. foo.txt # 忽略所有生成的 html文件, *.html # foo.html是手工维护的,所以例外. !foo.html # 忽略所有.o和 .a文件. *.[oa] 配置语法: 以斜杠“/”开头表示目录; 以星号“*”通配多个字符; 以问号“?”通配单个字符 以方括号“[]”包含单个字符的匹配列表; 以叹号“!”表示不忽略(跟踪)匹配到的文件或目录; 常用的规则: 1)/mtk/ 过滤整个文件夹 2)*.zip 过滤所有.zip文件 3)/mtk/do.c 过滤某个具体文....

【Java基础】Java获取系统信息(用户目录,临时目录等)

Java获取系统信息(用户目录,临时目录等) col1col2col3 java.versionJava运行时环境版本 java.vendorJava运行时环境供应商 java.vendor.urlJava供应商的 URL java.homeJava安装目录 java.vm.specification.versionJava虚拟机规范版本 java.vm.specification.vendorJava虚拟机规范供应商 java.vm.specification.nameJava虚拟机规范名称 java.vm.versionJava虚拟机实现版本 java.vm.vendorJava虚拟机实现供应商 java.vm.nameJava虚拟机实现名称 java.specification.versionJava运行时环境规范版本 java.specification.vendorJava运行时环境规范供应商 java.specification.nameJava运行时环境规范名称 java.class.versionJava类格式版本号 java.cla....

【FutuOpenD】CentOS下后台运行FutuOpenD

# cd FutuOpenD_2.7.650_Centos7 # nohup ./FutuOpenD >/dev/null 2>&1 &

【Linux】linux中/dev/null与2>&1讲解

首先先来看下几种标识的含义: /dev/null 表示空设备文件 0 表示stdin标准输入 1 表示stdout标准输出 2 表示stderr标准错误 先看/dev/null command > /dev/null相当于执行了command 1 > /dev/null。执行command产生了标准输出stdout(用1表示),重定向到/dev/null的设备文件中 /dev/null可以理解为/dev路径下的空文件;该命令将command命令的标准输出输出到空文件中; 再看 1>test.log 执行./test.sh > res1.log 或 ./test.sh 1> res1.log结果为 我们发现stdout被重定向到了res1.log中,stderr并没有被重定向到res1.log中,stderr被打印到了屏幕上。 2>test.log 执行./test.sh 2> res3.log结果为 我们发现stderr被重定向到了res3.log中 2>&1 command>a 2>&1 可以理解为执....

【Linux】CentOS下让命令后台运行并在前后台切换的方法

在命令结尾加”&”符号可以让命令在后台运行, 这时可以看到一个命令号和命令,后面是Running,表示正在运行, 输入fg即可将后台命令调回前台, 但如果有多个命令在后台运行,就需要jobs命令, jobs命令可以列出所有在后台运行的命令及运行状态, 这时使用fg空格后接命令号即可将对应的命令调回前台, 如果一个命令已经在前台运行,又不想结束他, 按Ctrl+Z即可将命令移至后台, 但这是可以看到该命令的状态是Stopped, 这时可以使用bg空格后接命令号将命令置于Runing状态. 上面的方法虽然可以让命令在后台运行, 但是退出登录或者关闭终端,后台的命令也会结束, 如果不想让命令结束就需要nohup了, 在退出后仍想继续运行的命令前面加上nohop空格借命令即可. ———————————————— 版权声明:本文为CSDN博主「一勺菠萝丶」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/weixin_39973810/article/details/90775927

【Linux】CentOS tar压缩与解压命令大全

tar命令详解 -c: 建立压缩档案 -x:解压 -t:查看内容 -r:向压缩归档文件末尾追加文件 -u:更新原压缩包中的文件 这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中一个。 下面的参数是根据需要在压缩或解压档案时可选的。 -z:有gzip属性的 -j:有bz2属性的 -Z:有compress属性的 -v:显示所有过程 -O:将文件解开到标准输出 参数-f是必须的 -f: 使用档案名字,切记,这个参数是最后一个参数,后面只能接档案名。 # tar -cf all.tar *.jpg 这条命令是将所有.jpg的文件打成一个名为all.tar的包。-c是表示产生新的包,-f指定包的文件名。 # tar -rf all.tar *.gif 这条命令是将所有.gif的文件增加到all.tar的包里面去。-r是表示增加文件的意思。 # tar -uf all.tar logo.gif 这条命令是更新原来tar包all.tar中logo.gif文件,-u是表示更新文件的意思。 # tar -tf all.tar 这条命令是列出all.tar包中所有文件,-t是列....

【Netbeans Platform】让Netbeans Platform支持终端Terminal 有更新!

参考 https://stackoverflow.com/questions/2257344/integrated-terminal-window-in-netbeans?r=SearchResults http://wiki.netbeans.org/TerminalEmulator http://wiki.netbeans.org/AJourneyThroughTheVirtualTerminal 首先下载Netbeans源码,我这里是Netbeans8.2的,将其中的lib.terminalemulator模块源码解压出来 将src目录下的org.netbeans.lib.terminalemulator包下的源码和examples\TermApp\src目录下的nbterm包下的源码拷贝到工程中 修改nbterm.Main中的static Mode mode = Mode.NONE // 因为Windows下不支持REGULAR,所以此处改为NONE // static Mode mode = Mode.REGULAR static Mode mode = Mode.NONE....

【Netbeans Platform】How do I route the output from an external process to the output window? 有更新!

How do I route the output from an external process to the output window? NetBeans 6.8 and up: Use the External Execution API. Implement a Callable which will actually start the process: private class ProcessLaunch implements Callable<Process> { private final String[] commandLine; public ProcessLaunch(String... commandLine) { this.commandLine = commandLine; } public Process call() throws Exception { ProcessBuilder pb = new ProcessBuilder(cmdline); pb.directory(new File(System.getProperty("u....

【jacob】异常Dispatch not hooked to windows memory 有更新!

在使用jacob将word文档转pdf时(这是目前将word文档转pdf最可靠的方式,缺点是只能在windows下运行),报Dispatch not hooked to windows memory,网上好多重复的帖子都没有解决。在经历了长达一天半的纠结,最后在一篇帖子中获得了灵感(具体那篇帖子找不到了,感谢原作者),是因为调用jacob将Word转pdf时,会在tomcat目录下的temp目录中生成临时的pdf文件,而在异常抛出之前,该pdf文件已经生成,但是大小是0KB,原因是没有权限写文件。正常情况下不会这样,但因为我这里是通过tomcat服务器启动的,而且是域账号登录的Windows Server 2008系统,所以会没有权限写入。将tomcat服务登录身份设置为域账号即可。 package xxx.transfer.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jacob.activeX.ActiveXComponent; import com.jacob.com.ComT....

【Netbeans Platform】Improved Output Window APIs 有更新!

There are several new classes that relate to the Output window, resulting in cool enhancements, such as the Output window in Test Runner. New classes include IOColorLines, IOColors, and IOContainer. Here's IOColorLines: try { InputOutput io = IOProvider.getDefault().getIO("Colorful Output", null); IOColorLines.println(io, "Hello....", Color.GREEN); IOColorLines.println(io, "how....", Color.RED); IOColorLines.println(io, "are....", Color.BLUE); IOColorLines.println(io, "you...?", Color.MAGENTA); ....

【acuistock】AnnotationPanel和Annotation相爱相杀 有更新!

MainPanel布局 ChartSplitPanel布局 ChartPanel布局 IndicatorsPanel布局 IndicatorsPanel中包含多个IndicatorPanel,每个IndicatorPanel除了绘制指标自身外,还包括一个指标工具栏IndicatorToolbox,和一个AnnotationPanel,即可以在指标上加注释。 AnnotationPanel实现了MouseListener,MouseMotionListener和KeyListener接口,相应鼠标按下,鼠标释放,鼠标拖曳事件以及按键事件。

【Netbeans Platform】Cooking with the NetBeans Platform v 5.5 有更新!

Antonio's $HOME NetBeans is 10 today!! Cooking with the NetBeans Platform v 5.5 Practical API Design Confessions of a Java Framework Architect.rar 1. About these notes 1.1. Why NetBeans Platform? I have always wanted to take a deep look at the NetBeans Platform as a mechanism for building large complex Swing applications. During this summer I have allocated some time to do so and the fact is that it's just fantastic! NetBeans is between six and eight years old. Sun adquired NetBeans on 2000, bu....