We, Java Programmers, are tired of writing- Getters, Setters, Constructors, and other boilerplate code or tired of reading this boilerplate code. Often the important logic in the class gets hidden due to these boilerplate code. May be in the coming… Read More ›
There was one query which came up on Javaranch– it was related to difference between using synchronized block with a method local variable and current instance “this”. I thought that this would better be explained with a code and I… Read More ›
Executing external command from within JVM often causes problems- be it in terms of the code to write and manage or in the ease of implementation. I had similar requirement in my Major project for my Under Graduate Degree, where in I had to launch a C program from the Java code. I ran into different issues like- the Main thread getting blocked, the GUI freezing, or reading the output streams and so on. Finally I had to give up the idea and stick with launching the external command externally 😛 Had I found the Exec library from Apache Commons then, my work would have been lot easier. Anyways better late then never. I will quickly go through how one can use Exec library to launch external programs from JVM- Its a wrapper over Java’s ProcessBuilder, Runtime.getRuntime().exe().
Before going into the details I will state the requirement: I need to fetch certain records from 3 different tables into 3 ArrayLists. I have 3 Classes which store the information: Lets name it- Class1, Class2, Class3. All the above… Read More ›
I cleared SCJP 6.0 with 81% on January 25, 2010 (putting this up after a long gap), not a really good score, but happy to get a “PASS” :). I did manage to do some 25 days of preparation (serious… Read More ›
I visited LBS College of Engineering, Kasaragod for a workshop organised by thier collegeOSUM Club. This was my first workshop outside NITK. They had suspended the classes for the afternoon so that most of them could attend the workshop. And… Read More ›
I executed a simple GUI application which would load the CSV file and parse it and show the contents in a JTable. When the applications started- There was a JFrame, 2 JPanels, a JLabel and a JButton with an Icon. I wanted to monitor the Heap size variations, the number of Classes, Threads details and also wanted to profile the application. So i thought of using VisualVM. The following are the results and snapshots of profiling using VisualVM. Note that the application had only one public class MainFrame in gui package. Also note that i was using the Nimbus Look and Feel.