Archive for category Java Tips And Snippets
Appending Characters In An Entire Column Of A Text File-Java
Posted by Abhishek Sharma in Java Tips And Snippets on August 25, 2011
I just fell in a situation where I was desired to put tabs in an entire column of a text file. MS-Word, MS-Excel were useless for this purpose. So finally I built a small java program that can handle around 1 GB of text file if your RAM allows. Although I didn’t tested it much […]
Showing JFrame at the Center of the Screen
Posted by Abhishek Sharma in Java Tips And Snippets on June 2, 2011
The simplest way to get your java application JFrame to show at the center of the screen if you are using J2SE 1.4+, then you have access to the Window method: setLocationRelativeTo(Component c) For Example: Use can use null for the argument (in place of component arg) to center your top–level container or your JFrame […]
Starting JavaDB (Derby) Network Server From Java Application
Posted by Abhishek Sharma in Java Tips And Snippets, JavaDB on May 31, 2011
Generally for beginners making a project find it difficult to understand how to start the Java DB network server or shut it down right from their java code. There are two ways to do this as described in Derby documentation (http://db.apache.org/derby/docs/dev/adminguide/tadminconfig814963.html): You can use the NetworkServerControl API to start the Network Server from a separate […]
Changing Background of JTree Nodes On Bringing Mouse Over Them
Posted by Abhishek Sharma in Java Tips And Snippets on May 17, 2011
Here is a program which shows you how to change the background or foreground of a JTree node when cursor is brought over individual nodes. Originally posted by Craig Wood on coderanch.com and enhanced by me(Abhishek)