• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

GUI Questions

Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi can some one tell how do I start working on GUI ? Can somebody explain the GUI archetecture here? I have the tentative layout of the GUI component. I have four panels. Panel1 consists of input details such as origin, destination, flight no, carrier etc. Panel2 consists of JTable to show the results after the Query button in panel1 is clicked. JTable will be in Single selection mode. A row selected in JTable is displayed in panel3(booking panel). Basically this will contain only one row. This panel also consists of provision to enter the no of seats to be reserverved. The fourth panlel will simply displays the status of any operation.
I am able to develop input panel separatly. However I am stuck with the JTable. Do I need to develop TableModel and then implement ? Or a Simple Table would be sufficient ?. Also How do I write an event model that If I press Query it should update ther Table with the data from Database. Clicking on Book button shoud make a call to database and then update the JTable. So Can some body throw their ideas on the archetecture of the GUI here ?
Posts: 17346
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, you have asked questions that make it large in scope. The best way to help you out is to look at the Model-View-Controller Design Pattern that is needed for GUIs. By separated the three parts into their own classes. The Model being a representation of the data, and the view being the display. The controller will be the listener of the view. The JTable uses this model, and it would be best for you to create a subclass of AbstractDataModel, and use that in your JTable.
That is the quick once over. You should check out Sun's tutorial on Swing, or some other fine manual on Swing
Hope that helps point you in some direction
And then we all jump out and yell "surprise! we got you this tiny ad!"
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic