1

I am working on a GUI based assignment (Sales Management Software) using Netbeans 7.1. It has 3 things -

  1. the interface
  2. the code
  3. the database

Now I want to know that, should i use 3 different packages for it or only one? Also what about the frames, only one frame and more panels will be the good approach for it or more frames?

Mat
  • 202,337
  • 40
  • 393
  • 406
codo
  • 45
  • 1
  • 9

2 Answers2

1

You can split it up however it makes sense to you. You can always refactor if necessary, so if it's a small application you can lump everything together in the beginning and start separating it into modules later.

The number of frames is also up to you. Some GUIs use separate frames, but others might use a single frame and display different panels by using a CardLayout or TabbedPane.

rob
  • 6,147
  • 2
  • 37
  • 56
  • *"Some GUIs use separate frames"* Like Gimp (shudder). There are very good reasons not to use separate frames. Follow the link in my answer for details. – Andrew Thompson Apr 29 '12 at 11:50
  • @ Andrew Thompson thanks a lot for providing me such a good information. – codo Apr 29 '12 at 11:52
  • @ Andrew Thompson , you have talked about cardlayout there is there any way to understand them how to organize them? I have often tried to use them in many projects but when there are many button on the jframe they just look very bad and unorganized, like i have tried it on Sales management assignment too, as it has many panels (menus) so doing it on one frame looks very ugly. Please provide me some good information on using them. – codo Apr 29 '12 at 12:02
  • @codo: You might look at this [example](http://stackoverflow.com/a/5655843/230513). – trashgod Apr 29 '12 at 17:34
  • It seems like you first need to understand [nested layouts](http://stackoverflow.com/a/5630271/418556). The idea would be to use a layout or combination of layouts that can contain related components and will assign extra space sensibly when resized, then put each of those groups into a panel that is added as one card of the card layout. I could make more specific recommendations with a more specific spec. ..on a new question. ;) – Andrew Thompson Apr 29 '12 at 18:18
1

..what about the frames, only one frame and more panels will be the good approach for it or more frames?

Not 'more frames'. See The Use of Multiple JFrames, Good/Bad Practice? for the reasons and alternatives.

Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433