This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
How have you added the icon to the button? Using the button's setIcon method? If so, check out the API of JButton's parent, AbstractButton. Look at the setXXX methods, there is one you want to look at.
following code, still I get the pressed look after pressing the button.
I dont want that effect which came after pressing the button (button is in pressed state)
First of all, pressing the button will cause the icon to change from normal.png to normalpress.png. If you don't want pressing the button to do that, then you shouldn't be calling setPressedIcon() [or you should set the pressed icon to the same as unpressed]. So I presume that's not what you are asking.
If normal.png and normalpress.png are the same size and have no transparent pixels, then I don't understand how you would see any "effect which came after pressing the button" since you have gone to the unusual step of replacing the button's border.
If they are different sizes or normalpress.png has transparent pixels, then you will probably (depending on your LnF) see the background color change. You should be able to disable this by calling longButton.setContentAreaFilled(false).