Creating a pop-up message

R

russianin

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.
 
O

Oliver Wong

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
 
R

Roedy Green

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top