using java.nio for super-speedy copies. More readable and less prone to errors than using Input/Output stream pairs and a byte buffer
try {
// Create channel on the source
FileChannel srcChannel = new FileInputStream("srcFilename").getChannel();
// Create channel on the destination
FileChannel dstChannel = newFileOutputStream("dstFilename").getChannel();
// Copy file contents from source to destination
dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
// Close the channels
srcChannel.close();
dstChannel.close();
} catch (IOException e) {
}
Showing posts with label jdk. Show all posts
Showing posts with label jdk. Show all posts
Friday, May 1, 2009
Wednesday, April 29, 2009
Baloon tool tips in java : Jbaloon
jBallon is a new LGPL library that allows you to have balloon-style tooltips instead of the standard Java tooltips - and there´s no need to change a single line of Java code from your application. No recompilation is needed, either. To use JBalloonToolTips in your project you have to add this line to the project's startup script: -Xbootclasspath/p:jBalloon.jar You can also mix standard and balloon tooltips in one app if you want.
Subscribe to:
Posts (Atom)