• 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Choosing the correct program structure: pl. do advice me

 
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello world,
I am hoping to write a stock controlling program. In that prorgam I want to to have these functions listed bellow. 1) Bill. (User can specify the quantity and the discount and add that entry to a bill.)
2) Inventory (User can add new items, update the item details and delete item details from the databse.)
3) Supplier (User can add new suppliers, update supplier details and delete supplier details.)
4) User (The administrator can add new users and delete. )
5) Reports (Various reports on the transactions, the items to be reordered etc.)
I am hoping to do the program in 'SWING'. The main window has a menubar and for each function I have mentioned above has seperate Menus. For example there is a 'User' menu which has 'Add User', 'Delete User' as menu items.
As you know,for example when adding a user, details are taken about the user such as the name etc.For this I need a GUI. The problem which I am having is do I need to create seperate classes which creates the GUI for each and every sub function ?.(example: adding a user)
So far what I have thought to have is, a main class for each of the main functions (for example supplier), and use the methods in that class to add, delete etc suppliers, and have different frames to get the GUIs in the main GUI. To make it more clearer this is the program structure what I have in mind.

public class abc {
public static void main(String arg[]) {
JFrame jFrame = new RMain();
}
}
class RMain {
/**
* Declare Components for the main gui.
*/
/**
* Declare Components for the Adding of a new user.
*/
/**
* Declare Components for the Deleting of a user.
*/
public RMain() {
}
}
class Supplier {
public Supplier() {
}
}
class User {
public User() {
}
}
program structure.

So is this structure ok?. or other wise do I have to have different classes for let's say 'AddSupplier' class which has the needed GUI components for adding a new Supplier. (I tried this but, I felt restricted when performing actions.)
Could you please advice me on this with your expertise knowledge.
Please if YOU know any online books for 'Good Programming or How to be a good programmer' please do tell me.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear u r going in a correct direction and working perfect try to lrn and read JDesktoppane, this might help u in adding, update and delete. do not make seperate class for each thing . ok now for programming go get Java Swing Book Deitel and Deitel both the green book and advance edition. programming can be learned from practice ... well practice practice make man perfect but no body ios perfect why do we need practice.

try to search some project related to u r project....
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks you very much for the advice.
 
I am going to test your electrical conductivity with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic