Win a copy of Terraform in Action this week in the Cloud forum!

William Kohus

Greenhorn
+ Follow
since Feb 19, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by William Kohus

Line 11 Gives me the following Error:
Unable to start activity ComponentInfo{bteamdevelopment.contactinformation/bteamdevelopment.contactinformation.ContactActivity}: java.lang.IndexOutOfBoundsException: Invalid index 2, size is 0


I'm able to Toast tvalues in line 13 and it prints each of my values so I know ArrayList<> values has items in it. It's weird because it's telling me it's an invalid index and the size is 0!??


Also, I'm able to print ALL of my results from the ArrayList if I use:
editAddress.setText(values.toString()); - That will populate my (EditText)editAddress with ALL of my values.

I guess my question is how do I pull a SINGLE value from the ArrayList and set it to my EditText?

6 years ago

Rob Spoor wrote:And which line is that in the above code? Because its line 71 is part of a comment.



I'm sorry in the SKUDictionaryR2 it's line 57. ----SKUList.add(foo5); ---- That is the code it doesn't like.

I can print the SKUList SKUDictionary.printSKUList(b); and it prints out what I've added, but when I have "SKUList.add(foo5); " In my code it gives the Null pointer.


Thanks so much!
9 years ago

Koen Aerts wrote:A stacktrace would be useful here...




Test save =false
java.lang.NullPointerException
at SKUDictionaryPackage.SKUDictionaryR2.main(SKUDictionaryR2.java:71)

That is what I get from it.
9 years ago
I can't seem to nail down why I'm getting this null pointer exception. I've exhausted all of my brain cells attempting to get it going. Any help would be greatly appreciated!






Here is where the SKUList is



9 years ago
Trying to compare two ID's and print a message if the ID's are the same. Having issues calling the method.




Here is the whole program.

9 years ago

Michael Dunn wrote:it's likely to be the way you've created the initial model

change




Michael Dunn, you are the man. Thanks!
9 years ago
I have to enter text into my jtextfield and have it show in the lbChoices jlist WHEN the focus is lost. It acts like it is there because I have a no duplicate line in there that appears when I try to type the same thing twice! Driving me crazy! Any help would be greatly appreciated. Thank you.





HERE IS MY FULL CODE


9 years ago

Michael Dunn wrote:> Now if I can just figure out how to add text to the jlist from the jtextfield on a focuslost!

really a bad idea (many reasons why accidental loss of focus),
better to add a little 'add' button beside the textfield




100% agree with you! Thanks again for your help.
9 years ago

Michael Dunn wrote:this is just for the add single button
(comment out your old method, in case you need it later)

replace with this




Thanks so much! I couldn't stare at it any longer. This also helped me get the add all button working as well! Now if I can just figure out how to add text to the jlist from the jtextfield on a focuslost!
9 years ago

Michael Dunn wrote:> Here is what I have so far. Now I just get the "No duplicates please!" message whenever I add anything to lbSelection.

OK, this bit looks easily fixable



now it shouldn't 'always' show.

do you still need help on duplicates? or was this all you were after?



I was hoping that line would prevent my duplicates but it didn't! So yes, still need help preventing duplicates!
9 years ago

Michael Dunn wrote:do you really need to retain all the teams on the left?

Most similar-concept programs I've seen move the selection from the left to the right (or back),
meaning no possibility of duplicates.



I guess I don't need them but the text box above lbChoices is for a user to enter another team so I think I would need to keep them in the left side list.
9 years ago
Here is what I have so far. Now I just get the "No duplicates please!" message whenever I add anything to lbSelection.

I need to recognize that there is a duplicate and prevent the value from being entered into the list!

Any help you can provide would be greatly appreciated! Thanks!













HERE is the whole program

9 years ago