I am writting a program for school that is supposed to act like a grocery store and have the cash register, inventory, checkout and the ability to add items and discontinue items.
So my question is that want to make a check out that will display each item from a linked list and then have a textfield next to it so the user can type how many of that item that they want?
But I do not know how to chang the amount of text fields so that it will not print to many text fields and that I am a me to talk to them to get the input?
If anybody have any good ideas or have a different way to approach this that would be greatly liked.
AIM : coala2000
Please Reply
Last edited by coala2000; 12-21-2008 at 07:40 PM.
Not sure I understand, you want to change text in a text box?
retrieving textCode:txtN1.setText("");
You could draw one text box for each element in the linked list.Code:txtN1.getText()
If that's not what you want, could you clarify better?
I want to display a check out of a grocery store but the items list will change in size so it will not always be the same amount of text fields on the window.
So I want to find a way to make that but have it change for the amount of things in the linked list?
Also can you use a Linked list for a JComboBox?
Thanks
If I understand what you are saying, the answer should be simple. Just use a loop to print out the contents of your linked list in a JLabel, and then add a text field right after the JLabel inside the layout you are using for the check.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks