I have a Point Of Sales and i want when items are sold, the items sold are deleted from database and show number of remaining items in a jlabel or jtextfield. I have tried the code but i cant make it. I appreciate your help.
Reduce item list when item is sold in POS
Page 1 of 15 Replies - 132 Views - Last Post: 15 November 2012 - 03:13 PM
Replies To: Reduce item list when item is sold in POS
#2
Re: Reduce item list when item is sold in POS
Posted 13 November 2012 - 02:23 AM
The first thing your going to need to do is learn swing so you can setup a basic window.
Your going to need to import a bunch of things:
Here is a swing example at the most basic level:
How to write an action listener: http://docs.oracle.c...onlistener.html
Video: http://www.youtube.c...h?v=jEXxaPQ_fQo
How to make a JTextField: http://www.roseindia...textfield.shtml
If you run into any problems, post them on here!
Your going to need to import a bunch of things:
import javax.swing.*; // For swing library components import java.awt.*; import java.awt.event.*;// For Action listener
Here is a swing example at the most basic level:
/*
The program demonstrates the use of JFrame
It sets the title to Hello World
*
*/
import javax.swing.*; // Needed for the swing class
public class HelloWorld extends JFrame
{
public HelloWorld()
{
// Sets the size of the window
setSize(300, 200);
// Sets the title of the window
setTitle("This is a Hello World Frame");
// Sets the action when the user clicks on the X of the window
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Sets the window to be visible
setVisible(true);
}
public static void main(String[] args)
{
new HelloWorld();
}
}
How to write an action listener: http://docs.oracle.c...onlistener.html
Video: http://www.youtube.c...h?v=jEXxaPQ_fQo
How to make a JTextField: http://www.roseindia...textfield.shtml
If you run into any problems, post them on here!
This post has been edited by MattDelly: 13 November 2012 - 02:24 AM
#3
Re: Reduce item list when item is sold in POS
Posted 13 November 2012 - 03:35 AM
Thanks but am not getting how i can reduce the stock when an item is sold.
#4
Re: Reduce item list when item is sold in POS
Posted 13 November 2012 - 03:38 AM
Create a variable containing the stock and use a counter
int cheese = 2; if(cheese == sold) cheese--;
#5
Re: Reduce item list when item is sold in POS
Posted 15 November 2012 - 02:04 PM
And how about using Sir.A need the help because my project have stopped because i got no idea on how to tackle the problem.
#6
Re: Reduce item list when item is sold in POS
Posted 15 November 2012 - 03:13 PM
This is ridiculous... talking in the clouds
Open a topic, post your code and we'll see
Open a topic, post your code and we'll see
Page 1 of 1
|
|

New Topic/Question
This topic is locked



MultiQuote



|