aspose file tools*
The moose likes Beginning Java and the fly likes Integer[] to a String while setting a text field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Integer[] to a String while setting a text field" Watch "Integer[] to a String while setting a text field" New topic
Author

Integer[] to a String while setting a text field

Chadd Franck
Ranch Hand

Joined: Nov 05, 2008
Posts: 50
Could someone tell me what is wrong?

assuming allStatsArray2 is an Integer[].

I keep getting null values I think.

I did a workaround like this

and it works what am I missing?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
Please supply more details. What happens? What happens when you simply print out the array (System.out.println(allStatsArray2) ?
Chadd Franck
Ranch Hand

Joined: Nov 05, 2008
Posts: 50
Well, unfortunately I changed all the code before I posted so I will have to take some time to rewrite a sampleClass to post. I just read the faq on how to post, will will give some more effort before I repost.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19557
    
  16

Originally posted by Chadd Franck:
Could someone tell me what is wrong?

assuming allStatsArray2 is an Integer[].

Have you also initialized each element of the array? "new Integer[X]" creates a new array object alright, but all of its elements remain null (or false for boolean, 0 for numbers, \u0000 for char). You need to initialize each one separately.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Integer[] to a String while setting a text field
 
Similar Threads
Generating a mandelbrot with Java
tortoise and hare race java applet not working properly?
How to use JSlider to adjust Text in a JPanel
Need help with drawing in a JPanel
Character reference "&#x0" is an invalid XML character