how to use actionListener in paint(Graphics g) method?????

That makes no sense. You can't put an action listener in a paint(Graophics g). What specifically do you want to achieve?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.