Results 1 to 8 of 8
  1. #1
    evoL is offline Member
    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0

    Default Hotel management system in Java

    I am fairly new to Java, I am currently reading Head First Java - Second Edition but haven't coded anything but basic variations of what I'm being taught in the book.
    I need to create a basic hotel management system. You know, customer comes, he gets a room for a specific time with specific services - something like this: Hotel Management System - YouTube
    I was kind of down about halfway through the book because although I think I'm improving I still had no idea where to start with my project. So by adressing my matter logically I figured I'd have to focus on GUIs as I have to make a program that obviously needs an interface. Researching about GUIs I ended up here: Lesson: Getting Started with Swing (The Java™ Tutorials > Creating a GUI With JFC/Swing)
    Good thing I was already learning Java by using NetBeans so I'm already familiar with it.

    Now my question is: am I doing this right? Is this the right way to go? I have to finish this project in about 2.5 weeks but I really want to learn Java so I hope it's possible.
    I'm confused because designing the GUI in that 'Design' mode NetBeans has, seems easy. Adding my own code to make each button do what it is supposed to looks really hard to me, even though I keep checking tutorials and frequently trying stuff from the book.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,086
    Rep Power
    20

    Default Re: Hotel management system in Java

    I usually start from the model.
    After all, it's easier to figure what data it is that's needed for the system to work.

    Then I would start to build a persistence layer for that model, and probably a bit of GUI work.
    You could swap those two, though.

    I also wouldn't use the designer unless you already know Swing very well, and what the quirks of the designer are.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    evoL is offline Member
    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0

    Default Re: Hotel management system in Java

    I have been learning Java for about 3 weeks and just discovered Swing so I don't know it at all. Wouldn't the designer make my job easier? I mean before finding out about Swing I was trying to draw every button and textfield etc with Graphics2D. Was that a better approach for a beginner?
    I didn't know what a persistance layer is but I googled after your post and I'm not sure I understood it exactly. You mean after having a basic understanding of what my data will be I should figure out how I store it? Like how do I store everything into a database? (I might've said some huge non-sense but searching java persistance layer got me here pBeans: Java Persistence Layer & Object/Relational Database Mapping (ORM) Framework)

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,086
    Rep Power
    20

    Default Re: Hotel management system in Java

    The designer really requires you to know how Swing works.
    In order to know that you really need to hand code Swing.
    It's not difficult.
    Here's the Oracle tutorial.
    Skip the Netbeans bit.
    Using Swing Components, Concurrency in Swing and the Laying Out Components Within a Container parts are the ones you really need to go through.
    For the components, just pick the ones you're interested in.
    You'd need to know this lot for the designer anyway.

    The persistence layer is the layer in which you stick your data somewhere so it can be retrieved later.
    If you were writing a game, then the persistence layer would be the save/load game functionality.
    In a business app it's usually a database, but could be a call to some service somewhere that does that work.
    The simplest form, for you, would probably be simply saving to a file...that's if you even need to save anything at all.
    I do a lot of db work, so that's why that layer tends to come before the GUI for me.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    983
    Rep Power
    2

    Default Re: Hotel management system in Java

    Don't start introducing all kinds of frameworks until you got a solid grasp of what Java and Swing are all about. Like Tolls said, start with your model (sometimes called domain). Make sure that works, even via System.out.println. Then try reading from and inserting into a database. You don't need a framework for that, just a Connection, PreparedStatement and ResultSet. This is what you would call your persistence layer. After that works, try creating a GUI using the basic blocks of Swing. Try different layouts, FlowLayout, BorderLayout, GridLayout and learn to use ActionListeners. This all combined will get you a long way.

  6. #6
    evoL is offline Member
    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0

    Default Re: Hotel management system in Java

    Ok so I will focus on Swing and that tutorial for the next few days.
    Yes I need to save stuff, like all rooms that are curently occupied and all kinds of things related to that. I need to be able to read that data, edit it, delete it and archive it for further check-ins. Something like.. a customer comes, he is given a permanent customer ID and I will be able to search by his ID and find out when has he checked in before, what services did he choose etc.
    Thanks a lot for your help!

    SurfMan, thanks for the step by step explanation. After the model I should focus on how I store my data and then starting the GUI that connects everything. Sounds good, not that scared of it anymore. Although I don't know how to start my model I'll keep researching, I feel like the database and Swing steps will be easier than actually making the model.
    Last edited by evoL; 04-25-2013 at 02:04 PM.

  7. #7
    Join Date
    Feb 2014
    Posts
    1
    Rep Power
    0

    Default Re: Hotel management system in Java

    Yes, You go in right way because Today's Graphics user interfaces (GUI's) are complex software components, which play an essential role in the usability of an application. A user interface model is a representation of how the end user interact with a computer program or another device and also how the system responds.

    You already familiar NetBeans so Following Links are useful for You:

    Tutorial: Using NetBeans to Create GUIs for Java Programs

    Designing a Swing GUI in NetBeans IDE
    Last edited by Jennifer Smith; 02-27-2014 at 12:54 PM.

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,079
    Rep Power
    6

    Default Re: Hotel management system in Java

    Well you're not yet a year too late with your reply, but almost.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Hotel Reservation in JAVA (help)
    By BattalGazi in forum New To Java
    Replies: 4
    Last Post: 07-31-2011, 08:32 PM
  2. Replies: 0
    Last Post: 07-22-2008, 04:39 PM

Posting Permissions

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