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