1

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).

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
S L
  • 14,262
  • 17
  • 77
  • 116
  • and why not go web ? ... there is good and easy framework like 'Play' ... just saying' – Alois Cochard Mar 17 '11 at 07:42
  • @AloisCochard I don't know in which direction i am going. – S L Mar 17 '11 at 07:43
  • honestly for me deskop java application have no future, web development is not that hard. Take a look at this: http://www.playframework.org/ and make your own opinion :) – Alois Cochard Mar 17 '11 at 07:53
  • @AliosCochard sure i will look at it, but currently i have to do this (client is always right), I am doing php right now, and i have interest in java too, sure i will have a look at it. Just wanted to know if I should do same for my client what i've done for college – S L Mar 17 '11 at 08:06
  • @expermientX ho yeah, client is always right - I know that too ;) good luck ! – Alois Cochard Mar 17 '11 at 10:21
  • Maybe use a DockingFramework: http://stackoverflow.com/questions/304874/what-are-good-docking-frameworks-for-java-swing – keuleJ Jun 18 '13 at 11:10

1 Answers1

2

..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.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • 3
    Also consider using [Java Web Start](http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136112.html) for deployment. – trashgod Mar 17 '11 at 08:36
  • @trashgod Great idea. But I prefer linking to http://stackoverflow.com/tags/java-web-start/info to describe JWS. SO's info tag on JWS includes **all** the best links I could find on the topic. ;) – Andrew Thompson Mar 17 '11 at 09:44
  • Excellent! Thank you for this comprehensive resource. – trashgod Mar 17 '11 at 15:26