Creating a pop-up message  
Author Message
russianin





PostPosted: 2006-4-21 20:10:00 Top

java-programmer, Creating a pop-up message Is there a way to have a text file or an excel file and in it list
dates and a message, then having my web page reference that file and
pop up with the message if the current date matches a date in my file.

 
Oliver Wong





PostPosted: 2006-4-22 1:06:00 Top

java-programmer >> Creating a pop-up message <email***@***.com> wrote in message
news:email***@***.com...
> Is there a way to have a text file or an excel file and in it list
> dates and a message, then having my web page reference that file and
> pop up with the message if the current date matches a date in my file.
>

Yes, but it's probably easier with the text file.

Scan through the file and compare every date listed with the current
date. When they match, display our pop up window with a label initialized
with the appropriate message.

- Oliver

 
Roedy Green





PostPosted: 2006-4-22 4:00:00 Top

java-programmer >> Creating a pop-up message On 21 Apr 2006 05:09:45 -0700, email***@***.com wrote, quoted or
indirectly quoted someone who said :

>Is there a way to have a text file or an excel file and in it list
>dates and a message, then having my web page reference that file and
>pop up with the message if the current date matches a date in my file.

There are many ways to skin this cat. If the file is huge, I would do
it with a file of strings written with DataOutputStream.writeUTF, one
after the other.

You create an in RAM lookup table that indexes by message number to
get the offset in the RandomAccessFile, then do a
DataInputStream.readUTF to get your string back.

Alternatively use a HashMap to index by message code string to get the
offset.

If the file were smaller, I would use a ResourceBundle. See
http://mindprod.com/jgloss/resourcebundle.html

If it were no internationalisation concerns, I might just use a
Properties file which turns into a RAM-based Hashtable.
see http://mindprod.com/jgloss/properties.html



--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.