Multiplex Theatre Ticket Booking System-Netbeans-MySQL-Java Project

Posted on 2011-10-30
Last Modified: 2012-05-12
Note: Answers and helps can be to any part of the question.

I am developing a Java Application with front end GUI developed through Netbeans with backend - MySQL Database. I passed initial hurdles. Now I am facing these troubles while development:

- How to Refresh/Redraw table after a row is added/deleted- automatically or using a jbutton. Note my table model is defaulttablemodel and note abstracttablemodel or connected to Vector.

- How to obtain values from a row in a table? I should get cell values from each column in a row and want to display in a separate textfields(look for screenshot). I used Binding- found from this site:
I received text from each cell value in a row when Binding is used. However it made my coding complex. Is there any other alternative simple way?

 I thought of this method -when a user clicks a row in a table, the following event and  code executes:
private void movTableMouseClicked(java.awt.event.MouseEvent evt) {                                      


int row = movTable.getSelectedRow();
int column = movTable.getSelectedColumn();

    Object a = movTable.getValueAt(row, column);
    Object b = movTable.getValueAt(row, column+1);
    Object c = movTable.getValueAt(row, column+2);
    Object d = movTable.getValueAt(row, column+3);

Open in new window

In this way I can display row values in separate JTextfields. However in this case I want to make all my columns except Movie column unselectable? Otherwise error will appear. How can I select only one column of a row at a single click? The rest of the cells in a row except movie cell should be disabled. Is it possible through property options of JTable?

- I want to assign a ticket number for each ticket booked. I am planning to have 8 theater screens. Screen name: A,B,C,D,E,F,G,H or 1,2,3,4,5,6,7,8.
All the screens will have 200 seats. Each row contain 10 seats and there are 20 rows in every theater. When the first user in a day book movie in 'A'(1st) Screen and books one ticket, the ticket number assigned will be 'A001'. If he books two tickets, the ticket numbers should be 'A001', 'A002'. If he books for movie in 'C' Screen(i.e 3rd Theatre/Screen), the ticket number assigned should be 'C001'.
Ticket number once assigned should not be available to subsequent bookings. The whole process resets when the show finishes.

I think while or do while clause can do the above job.

- I want to show currents booking position of each screen(no seats remaining) after each ticket(s) is booked. I need to display remaining seats in JTextfields after each successful booking. ( Using some kind of decrementation).

There are more problems coming up...

Please suggest some ideas to simplify this project. I would like to  delete few details and components. However the basic features of a Real time Multiplex Theatre Counter Booking should remain.

Please ask me for any questions concerned.
Question by:octoberqueen
    LVL 86

    Accepted Solution

    - How to Refresh/Redraw table after a row is added/deleted- automatically or using a jbutton. Note my table model is defaulttablemodel and note abstracttablemodel or connected to Vector.

    Shouldn't be a problem:
    LVL 86

    Assisted Solution

    >> Is there any other alternative simple way?

    If you keep your text fields in an array:
    int row = movTable.getSelectedRow();
    	TableModel m = movTable.getModel();
    	for(int col = 0;col < m.getColumnCount();col++) {	
    	    textFields[i].setText(m.getValueAt(row, col).toString());

    Open in new window

    LVL 86

    Expert Comment

    btw, there are too many questions in one posting - i've already answered one too many really ;)

    Author Comment

    Is there any simple way to implement my Multiplex Theatre Booking System in Netbeans JAVA?
    Only requirements are there should be a JTable and  Database connectivity-MySQL.
    Any simpler modification of GUI Front so that whole process can be easily done.
    LVL 86

    Expert Comment

    There are no secret or obscure ways to get your job done.

    Author Comment

    Sorry I only wanted my project to be as simple as possible. If any of you can suggest better ideas, I will be very grateful.
    LVL 86

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    bigHeights  challenge 13 43
    noX challenge 17 52
    parentbit challenge 3 36
    maven java path setting 5 31
    This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now