S L
S L

Reputation: 14318

First database desktop application

I am quite novice to Java (re-learning) and I am trying to make a database desktop application. The system will be used for a recording the incoming and outgoing of goods for a wholesaler.

I had done similar kind of application (Student Management System) before as my college project (2 yrs before) without adequate knowledge of OOP.

  1. first I had a JFrame for log in, and when logged, the login frame would close showing the other frame.
  2. A frame would act as control panel (similar to dashboard) for navigating.
  3. The other frame would be provide a specific interface and will close on going back showing the control frame and hiding the closed panel.
  4. Abstract table model class was used for fetching the query and JTable or some table was used for displaying the result.

  5. To sum up, I simply had lots of frames that would hide and show, and Display table

To be honest, I , at that time, knew nothing more than what was in the book which i didn't bother to scrutinize every line of code, and still haven't seen such an application.

My Question is, how should be a the cascade of JFrames be, everything is managed within a single frame? Also I would be grateful on suggestion of framework (for such kind of application) and any sample project (if any).

Upvotes: 1

Views: 1101

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168825

..how should be a the cascade of JFrames be, everything is managed within a single frame?

There are a number of options:

  • Remove the old components and add new ones. Not highly recommended. Error prone and usually unnecessary.
  • Use JInternalFrames in a JDesktopPane for multiple views of the same types of data.
  • Swap one set of components for another using CardLayout.
  • Put each set of components into a JTabbedPane.
  • If there are always logically a fixed number of objects (e.g. product tree, product description, stock levels by store table), you might put them in different areas of a BorderLayout, or toss in a JSplitPane to allow resizing of space between GUI elements.

See the Laying Out Components Within a Container lesson of the Java Tutorial for ideas & examples.

Upvotes: 2

Related Questions