Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Creating a pop-up message

Thread view: 
russianin@gmail.com - 21 Apr 2006 13:09 GMT
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 - 21 Apr 2006 18:06 GMT
> 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 - 21 Apr 2006 21:00 GMT
>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

Signature

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.