OK, but the items are stored in the database, is there a way that i don't need to add a blank row in the database
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
OK, but the items are stored in the database, is there a way that i don't need to add a blank row in the database
You can add the new blank item at runtime, as well as the items from the database.
NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:
When asking for help, please follow these guidelines to receive better and more prompt help:
1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
2. Give full details of errors and provide us with as much information about the situation as possible.
3. Give us an example of what the output should look like when done correctly.
Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/
i think adding a blank item in runtime would be better. How would i be able to do that?Sorry.
Thanks
Last edited by kpat; April 3rd, 2012 at 09:11 AM.
Use the JComboBox.insertItemAt(Object,0); method.
NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:
When asking for help, please follow these guidelines to receive better and more prompt help:
1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
2. Give full details of errors and provide us with as much information about the situation as possible.
3. Give us an example of what the output should look like when done correctly.
Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/
problem solved
Last edited by kpat; April 8th, 2012 at 07:27 AM.
What variable has the null value?i got this error java.lang.NullPointerException?
If you don't understand my answer, don't ignore it, ask a question.
kpat (April 3rd, 2012)
I managed to fix the problem, after some playing around thanks to both of you.
Norm & aussiemcgr thank you both for your help and support when i had a problem.
Last edited by kpat; April 3rd, 2012 at 11:06 AM.
problem solved
Last edited by kpat; April 8th, 2012 at 07:26 AM.
Please make a small, simple program that compiles, executes and shows the problem.
If you don't understand my answer, don't ignore it, ask a question.
problem solved
Last edited by kpat; April 8th, 2012 at 07:26 AM.
When you wanted to insert the empty String into the list.
If you don't understand my answer, don't ignore it, ask a question.
problem solved
Last edited by kpat; April 8th, 2012 at 07:27 AM.
What happens when you execute the insertItemAt("",0) method?
Where is the empty String added?
If you don't understand my answer, don't ignore it, ask a question.
problem solved
Last edited by kpat; April 8th, 2012 at 07:27 AM.
Can you show an example by making a list and adding comments to describe the problem:
first item << can see this one
second item
third item
If you don't understand my answer, don't ignore it, ask a question.
problem solved
Last edited by kpat; April 8th, 2012 at 07:26 AM.
Have you tried any of the JComboBox class's methods to change what is shown?
If you don't understand my answer, don't ignore it, ask a question.
yer but nothing. i tried messing around with the placing and setSelectedIndex(-1) and etc. any ideas?
I'd use one of the JComboBox methods.
If you don't understand my answer, don't ignore it, ask a question.
problem solved
Last edited by kpat; April 8th, 2012 at 07:26 AM.
Do you have the API doc? Read it looking for any methods that will do what you want. Try all that look useful with lots of different combinations of arguments and see if any of them do what you want.
If you don't understand my answer, don't ignore it, ask a question.
ok fine thanks
I think you will have to use one of the class's methods. You can experiment the same as I would have to experiment to find it. You will learn something by doing the experiments that will help you in the future.
If you don't understand my answer, don't ignore it, ask a question.
problem solved thanks guys