Hi I am coding an alarm application.
I use a JButton to set the alarm. I use the same JButton to warn the user about choosing any file other than an "mp3" file for alarm ringer. But the button works only once.
Here is the code
But I want the button to work as many times as user selects a file other than an mp3 file. Can somebody please help me with this
Remember the (==) comparison is object comparison, it checks if the objects on both sides of the == signs are the same.
The .equals() method compares the string value of the string objects, which is what you want to compare.
Unnar Björnsson wrote:Remember the (==) comparison is object comparison, it checks if the objects on both sides of the == signs are the same.
The .equals() method compares the string value of the string objects, which is what you want to compare.
Thank you,can you help me out with my main problem?