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.