This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Originally posted by divya sharma: So what's a solution for this ??
If your application consists of just this one class, then the problem is, as the first response states, that you don't have a "public static void main(String args)" method. Without one, you don't have an application, merely a class.
To use this one class, you need a minimal main() method. It would have to create a JFrame, put your JPanel into it, set the size of the JFrame and call setVisible(true) on the JFrame to make it appear on the screen. Something like