Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-04-2008, 07:34 PM
Member
 
Join Date: Jan 2008
Posts: 5
jazzinspace is on a distinguished road
Appointments Diary.
This is my first ever whole program that I am attempting. I'm trying to create a simple appointments diary in java and using jewl as my GUI.

The system will work like this:

Using the HashMap class I will store a date and an appointment (from the calendar class) - new HashMap<GregorianCalendar, Appointment>.

In a seperate class I will make the appointment itself. The user can record their name, the appointment, the duration, the location and the date of the appointment. This will all be stored as a HashMap.

This will be inputted through a jewl interface - of which I have no idea how to construct a calendar looking UI. Apparently there is a class out there that is premade that looks just like a calendar.

I don't know how to save this Diary so that when I close the program it will open up with all the appointments in it.

I am a little stuck for where to start to be honest. Any help would be endlessly appreciated, I'll check back on this forum 2nite. Many thanks, Jack.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-06-2008, 09:33 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
Code:
class YourGuiClass { DateBook dateBook; public YourGuiClass(DateBook db) { dateBook = db; } private JPanel buildGui() { // put your gui components together here // Use the "dateBook" reference to get the // appointment data to fill in the gui components. // rturn completed component. } public static void main(String[] args) { DateBook db = new DateBook(); // add your appointments ... YourGuiClass ygc = new YourGuiClass(db); JPanel content = fgc.getContent(); JFrame f = new JFrame(); f.add(content); // add other gui components as desired // configure and show frame } } class DateBook { Map<Date, Appointment> appointments; public DateBook() { appointments = new HashMap<Date, Appointment>(); } public void addAppointment(Appointmment appointment) { appointments.add(appointment.date, appointment); } // other methods as desired } class Appointment { String name; String location; Date date; int duration; public Appointment(String name, String location, Date date, int duration) { this.name = name; ... } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +3. The time now is 04:44 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org