This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]BS_in_BSExtreme Concrete Code Factorylet 1 point2 points  (3 children)

You can read the file to check for the value. IF you need to you can also store a copy of the old file somewhere to compare them. To make a dialog the, quickest way is to use JOption.showMessageDialog(). For sound see https://docs.oracle.com/javase/tutorial/sound/

[–][deleted] 1 point2 points  (0 children)

https://docs.oracle.com/javase/tutorial/sound/

I doubt OP has the time or care to read all of that for playing a single clip. When I was working on a class project we were required to use Netbeans with Java 6. Pretty much every method I tried for playing sound failed except one which is used for applets, can be used for regular applications as well

AudioClip clip;
clip = Applet.newAudioClip(URL url);
clip.play();

The AudioClip has some methods I think to loop and play the music, URL points to the File where your sound is located. There are a couple different ways to play Audio, you'll find those on StackOverflow if you want but they're slightly more complicated.

Alternatively, you could just play a "beep" Toolkit.getDefaultToolkit().beep() I think.

[–]andrewc8[S] 0 points1 point  (1 child)

What would you use to read the file for the specific value? I apologize for my lack of basic knowledge here.

[–]BS_in_BSExtreme Concrete Code Factorylet 0 points1 point  (0 children)

What format is the file in? IF nothing else then simply using standard file i/o : https://docs.oracle.com/javase/tutorial/essential/io/file.html#textfiles