Capturing Screen in Java, Your Own printscreen

I happened to visit a cyber cafe for some reasons, and I had to take the screenshot of the screen and Alas, for some (security :P) reasons, print screen was not working. Grrrr..
Luckily, the guy had JDK installed on his machine and I had some good 10 – 15 minutes to pull this up. So I decided to quickly use Java to capture the screen and thought to share the Utility with you. Offcourse! I have now added Swing help everyone out here.
You can skip the entire post and can play around with the code / utility with section downloads below –
Downloads –


No I want to code!

Understanding Byte Code in Java

[Q] So, what is Java Bytecode ?
[A] Bytecode is the heart of Java portability. Each Java program you write is first converted to a .class file (bytecode), which is then interpreted by Java interpreter.
Few days before I came to an interesting post, which provided a sample code in Java byte code format. Interestingly decoding the code to Java was no big deal as plenty of tools are available like JAD.
But it sparked something more than just the sample code, why is byte code important and why must a Java guy know that ?
Know Why!

Getting started with SQLite Android

Adding to Project To add storm to your Android project, please use below for Gradle in your project specific Gradle file. This would add Cubestack bitray Mave repository to your project maven { url “http://dl.bintray.com/cubestack/maven” } Once Maven repository is added, you may import Storm to your project with current Read more…

Creating and reading Annotations & Reflection in Java

Annotations are very helpful tool while programming in Java. It is a alternative to the traditional XML based configurations. Spring has picked it up early and I must admit quite beautifully.
In case you are working on something and want to use annotations for your code, here is a small guide; it will definatly make your code look clean and also will kick off the trouble of reading XMLs.
For simplicity, lets create a mock of reading column name and its value, similar to JPA.
 Get the Code

Understanding Blocks in Java

Java provides several ways of instantiating objects / classes. One of the most interesting features being blocks.
Java gives you an option to create two types of blocks –

  • Initializer blocks
  • Static blocks

Initializer blocks popularly known as Instance initializers are used to do something when an Object is created. Simple program below demonstrates a block :
[ad#in-blog]
Complete post!