Results 1 to 19 of 19
  1. #1
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Lightbulb First JAVA project: scheduling system

    I am a newbie to JAVA and I want to get my feet wet with it so I can understand it more. We have a manual scheduling system in our school and I would like to make a program that will ease the process, and so that we will be able to avoid conflict of schedules and know easily which rooms are available at what time.

    Our school schedule is from Monday to Saturday, 7AM up to 6PM. My goal is to be able to let a user save a certain schedule to a room (ex. 7am-9am in room101), and avoid conflicts with that schedule (8am-up for example) will not be allowed. And of course, to know what are the free time of the rooms.

    I want it to be graphical in nature. Now, anyone who can tell me where to start?

    TIA

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Start with understanding what you want your app to do and then design a program to do it.

  3. #3
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    Attached is a sample GUI I am thinking of, can this sort of thing be done with JAVA? The logic is that there should be no overlapping of time per room.
    Attached Thumbnails Attached Thumbnails First JAVA project: scheduling system-schedule.jpg  

  4. #4
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Yes it can be done in Java, but I don't know if this is a good first project. Have you ever played with Swing? You're talking about GUI, so you're going to need Swing and AWT.Event. I assume you're going to want to save the schedule, so IO will be needed. How much Java have you learned?
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  5. #5
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    I have done my "hello world" already. =) I want to tackle a project as I go along so I will be motivated more to study it as I have done when I self-studied VB6 and C#. What control can I use in such stuff?

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default

    Forget about that darn GUI for the moment and think about the scheduling: can those rooms be booked every half hour starting on a half hour? If so a simple BitSet can do the job, if not, you have to think about this problem first. You have to come up with something like:

    Java Code:
    // return true if the booking succeeded
    public boolen bookRoom(Room room, TimeSlot start, TimeSlot end) { ... }
    It's up to you to come up with suitable definitions of a Room type and a TimeSlot type. When that is all done you can start thinking about those GUIs again.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    The main thing really for now is that no time should overlap and I could use an SQL for that or do I have other options in Java? I don't know how to describe it but as you can see in the image, each time should start at 0 minute (7:00) or 30 minutes (7:30), no other else (cannot be 7:10, etc.).

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by dee-u View Post
    The main thing really for now is that no time should overlap and I could use an SQL for that or do I have other options in Java? I don't know how to describe it but as you can see in the image, each time should start at 0 minute (7:00) or 30 minutes (7:30), no other else (cannot be 7:10, etc.).
    As I wrote: have a look at the BitSet class where each bit represents half an hour. That class has methods that can come in handy here.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    Hmmmnn... I browsed the BitSet class and I am not sure how I can use it in my case, can you elaborate more? =)

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by dee-u View Post
    Hmmmnn... I browsed the BitSet class and I am not sure how I can use it in my case, can you elaborate more? =)
    Sure, map those time slots to a bit, i.e. 7:00am --> bit 0, 7.30am --> bit 1 etc. etc. A potential booking can be represented by a couple of bits, e.g. 01111 (7:30am -- 9:30am); another Bitset represents the succeeded booking for the room, e.g. 000011111 (9:00am -- 11:00am). The intersects( ... ) method in the BitSet classs tells you that you can't book that room for the time slots 7:30am -- 9:30am. There are more handy methods available in that class; let your imagination do the work, you wanted to get your feet wet ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  11. #11
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    Oh no, I am not just wet anymore, I am now drowning! =) Thanks, will look closely into your idea.

  12. #12
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    If you've only completed your Hello World program, then I suggest you just buckle down and hit the book. It will take a bit of work before your ready to tackle a program like the one you described. There is a lot about Java that you must learn, once you get some basic knowledge about Java you can start designing your project and you can start tackling it one piece at a time. It will make much more sense then.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  13. #13
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    Hmmmnnn... I think I could just use an SQL for checking the overlaps instead of the BitSet class, am I not right? My main problem really is how to come up with the GUI I am thinking of, can anyone provide some suggestions on where to look into for such design?

  14. #14
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    You should probably progress through the lessons properly. There's no use in learning Swing and AWT if you don't know the fundamentals of Java.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  15. #15
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    What fundamentals should I go through then? If you mean the syntax then they are already somewhat familiar to me being a C# programmer, I could just refer to the manual what the appropriate syntax is.

  16. #16
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    You're trying to run before you can walk. You want to hop, skip and jump along in Java but there are some key parts that are no way related to C#. Do you know what the JVM is? How about the Garbage Collector? In most books they will go through and teach you everything you need to know in an order that makes sense. Think about it, if you started reading a book about Java whats the worst that could happen? You could learn something, and since the syntax is similar you wouldn't have a problem adapting. You need to know the basics of Java, everyone here will tell you that you're trying to start at the finish line.

    If you don't want to learn Java properly, then this might not be the right forum for you. If you are willing to start from the beginning and work towards your goal, then this is the right place. If we told you what references you needed to accomplish your task and you just jumped in, you wouldn't receive too much sympathy when you came back asking questions about things you should've learned first.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  17. #17
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by dee-u View Post
    Hmmmnnn... I think I could just use an SQL for checking the overlaps instead of the BitSet class, am I not right? My main problem really is how to come up with the GUI I am thinking of, can anyone provide some suggestions on where to look into for such design?
    Cool, you want a great GUI but you don't know what it is that it should do. As suggested by others already: go and read your books before you start dreaming about great GUIs. Try your SQL idea and see if it works better/simpler than the BitSet idea. Those GUI components can wait, they don't rot.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  18. #18
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    I have an idea on how it should work. It should be able to display all the rooms saved in a database, and in the right side it will color code all the occupied time slots (red for occupied and green from the free time), and it will be from Monday to Saturday. It is quite simple in my mind but to be honest I don't know if I can implement it in the design I want.

    Does Java have something like a TableLayoutPanel in .Net? It maybe able to do what I have in mind.

    Sorry if I may look very eager to tackle something like this. When I self-studied C# (without even a single book but by just browsing the internet and asking in forums [www.vbforums.com]) I was able to pull it off and made a simple Employee Information System using a 3-tier/layer design. That was my goal, to accomplish the program and it motivated me to study it, and I am thinking the same in Java.

  19. #19
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    It has multiple layout options, it also allows you to design it without layouts using hard grid points. There are plenty of ways to design a GUI. These are things you learn when you start learning about GUI. Once you get to GUI and read the tutorials and chapters it will make everything more clear.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

Similar Threads

  1. Job Scheduling in java
    By umapathy_sekar in forum Advanced Java
    Replies: 2
    Last Post: 09-13-2010, 05:27 PM
  2. Job scheduling using timers in java
    By umapathy_sekar in forum New To Java
    Replies: 1
    Last Post: 09-13-2010, 05:18 PM
  3. * Help: Java Code For Cpu Scheduling Algorithm
    By coldvoice05 in forum AWT / Swing
    Replies: 2
    Last Post: 03-10-2010, 03:43 PM
  4. * Help: Java Code For Cpu Scheduling Algorithm
    By coldvoice05 in forum New To Java
    Replies: 1
    Last Post: 07-15-2009, 04:30 AM
  5. need help for my PROJECT(notepad system)
    By hrithik4568 in forum New To Java
    Replies: 0
    Last Post: 05-06-2008, 10:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •