Hi friends, welcome to Pugil's Funny Channel. Today I am going to teach simple inventory management system using Java SS
So let's run and check how the program works. So this is Java SS, I have made by Java SS here
If you select it here, the box is loading. If you have a gram calculation, if you have to select a gram, I am going to buy chicken 500 grams
Click that button, 500 grams price will be displayed. I am going to buy 1 kilo, the price will be 500
So 2 kilos, 1000. 3 kilos, 4 kilos, it is working perfectly well
So how to use this program step by step, we will see
Now first what I am going to do is, go to the file, new project, Java, sorry Java SS, this XML, you have to have Java SS XML, you have to choose this XML file
So here I am going to use chicken sub SS, Java SS JS, finish
I am going to do the project with Java SS, I have already done in Java swing application, the same project I am going to bring in the Java SS
So that I, here Java SS, so where is the project, Java SS
Java SS, this is there here, ok, see, ok, this one
Java, you can see here, once you differentiate between Java swing and Java SS, you can see the symbol of SS, ok
You have to expand the project little bit. These are 3 files are very important stuff, right, this is the main file
Next I am going to go to, first I am going to design, double click on this one, just blank design, I just click and press B, again get rid of this button
I have got to expand it little bit, right. Ok, I am going to make the design, first I am going to put the library, you have to type label, drag and drop over here
You can type, click on short, press enter key, it will be applied
Just click on here, you have to expand there, you have to increase the font little bit
Font size, family I am going to select, something like this, this one, ok, perfect
You can also increase a little bit, right, perfect. Select this one, just isolate, alright, good, right
Here you have to color, I am going to choose as this color, right. Now look at what I am going to do, I am going to drag one panel, panel, this panel, panel
You have to drag one panel, right, panel. What you are going to do is, this is a panel, you can give it any style, click on this one
I am going to change the color, so go to the properties, here this is style, background color, you have to choose as any color, background color
I am going to choose here as black, so type black, press enter key, it will be changed as black
I am going to drag the label, so you have to type the library label, here the color I want to change it as, this one label as black and I am going to change it as white
Increase the size a little bit. Here I am going to, text I am going to give as a chicken
Now you drag the combo box, so combo box here, so type combo box
Combo box also I am going to name it as chk, so this is not a name, I am going to name it as, this one, code chk combo, press enter key
Here I am going to drag another label, so label, drag it over here, this label I am going to name it as, properties, name it as quantity, press enter key, this is quantity
So this also I am going to drag, size it as, little bit, and size, text color I am going to change as white. Perfect
After that what I am going to do is, I am going to drag the text field
So not this one, this one. After that what I am going to do is, I need one button, so button, this button name it as, add, press enter key
If you want you can change the color as well, so I will default, leave it as default
That's all, I need a, the file, I need another label, this label I am going to display the final total, so this one
Here I am going to increase the size little bit, here we have to make it as black, add here white, or we have to, so it has to be yellow, yellow is the perfect one for showing the final total
Here I am going to name that, this one, code chk build, press enter key, that's it
This one select this one, php quantity. Ok, click that. This button also you have to name it as, btn, add
This one on action button, add. These are the all things you have to do. Ok
Then only the, see the name, they identify the labels and all the stuff. Ok
Now this is the code I have done it. File, save. Then only the xml is saved
Now you have to generate the code, show this one. You have to get them the code
This code I just copied, so you have to copy, back to our project, that's my project, this is a project
You have to get rid of this blank, it's not clear, this one
Effects, sorry, where is the file, this one. Controller, this is a blank one
I just get rid of this blank. You have to paste it over here
That's it the things you have to do. Right, this is not an error
You have to paste the balance, this one. All the classes also you have to copy, you have to paste above
That's it. Error will go away. Now this is your file. Now if you run and check the xml, it's working
Now you can get the output successfully, working. Now I want to load this one, so what I'm going to do is
come back to loading, hit initialization, just copy and paste it, I have to explain it, how to write it, ok
Right, so here what I did here is, so this is namespace, right
hits combo, but names are given hits combo. Hits combo, that's it
I basically tried. Ok, this label, combo box, text field, all the stuff are given
The combo, I'll give a list. So list you have to mention as a data type, I mention as string
Ok, so here, first how to load the combo box, we can't load it from the string directly
so here you have to call it as a list. Observe the list
You have to make it as a data type string, list, you have to take the object list
fx collection, this class, you have given, but if you are going to load
I'm going to load that combo box, only gram and kilogram, so I'm going to provide a gram and kilogram
This all the stuff I'm going to set in to there, the combo box. So combo box name I have given this name
chk combo, while I design the combo. Ok, so here, this name
chk combo. Dot, step title, that is all the list, what is the list you have selected
this list item you have selected here. So then the program initialize
this item get loaded. Gram, kilogram, it's getting loaded. That's the thing it do
Ok, alright. After that what I'm going to do is, here, my URLTC
whether it's loading fine or not. It's loading successfully. Now if you have select the item
and enter the quantity, the total should be this way. So here, I have already done this code as well
So, very simple code, I will be explaining. This all the code I have provided in my website
you will be able to download it. Download the chk combo. chk quantity
This is the name I have given, chk combo. So this is the, you have a add event
This is action listener. This is action listener, what I did is, what is the value you have selected on this combo box
gram, kilogram, it will be assigned to this s variable. Here, get selected node, get selected item
it will be assigned this variable s. Ok, if you have selected gram
it is assigned to gram. If you have selected kilogram, it is assigned as kilogram
After that we have to declare two variables, shell and quantity, where
So, quantity, this is a quantity, we have to double, we have to convert as a double
chk quantity, this is our text field name, what is the quantity I entered on the text field
it is assigned to this variable. After that what I did here is
after that what I did here is, after that we have to do the calculation part
If this says, what is the, if you select as, if it says to me the data is assigned to this variable
equivalent, if you select as gram, gram's calculation will be this way
How to calculate the gram? Your price, that one kilogram price is thousand
sorry, five hundred, here into quantity, what is the quantity I entered on the initial field
it is divided by thousand. Why you have thousand, one kilogram, one gram, thousand kilogram, right
So, else we have to do the kilogram calculation, this is the gram calculation
Kilogram calculation we have, just we have to include quantity. After that finally we have to print that order
so, txt build, this is the text field name I have given
set as, here you have to, this cal, you have to pass it here
get that order, you have to convert as, string dot values, that simple stuff
Let's try and I check again, one, hundred kilo, hundred, hundred gram
this price, kilogram, one kilogram, thousand, right, perfect. I hope you guys you understood it in spell
if you have any doubt you can ask me anytime. Thank you for watching