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
169k42 gold badges224 silver badges441 bronze badges
asked Mar 17, 2011 at 7:32
6
  • and why not go web ? ... there is good and easy framework like 'Play' ... just saying' Commented Mar 17, 2011 at 7:42
  • @AloisCochard I don't know in which direction i am going. Commented Mar 17, 2011 at 7:43
  • honestly for me deskop java application have no future, web development is not that hard. Take a look at this: playframework.org and make your own opinion :) Commented Mar 17, 2011 at 7: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 Commented Mar 17, 2011 at 8:06
  • @expermientX ho yeah, client is always right - I know that too ;) good luck ! Commented Mar 17, 2011 at 10:21

1 Answer 1

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.

answered Mar 17, 2011 at 8:24
Sign up to request clarification or add additional context in comments.

3 Comments

Also consider using Java Web Start for deployment.
@trashgod Great idea. But I prefer linking to 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. ;)
Excellent! Thank you for this comprehensive resource.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.