aspose file tools*
The moose likes Java Micro Edition and the fly likes ListField arrayindex out of bounds exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "ListField arrayindex out of bounds exception" Watch "ListField arrayindex out of bounds exception" New topic
Author

ListField arrayindex out of bounds exception

adroit dhanwada
Greenhorn

Joined: Apr 18, 2007
Posts: 16
i created ListField in blackberry jde.
ListField list=new ListField(4);
if i say :
list.insert(0);
it is giving ArrayIndexOutofBounds exception.iam not calling callback.insert() method also(i commented it).can someone help with this please.is CLDC based applications complex to develop?
Thanks
Sayan Jaipan
Greenhorn

Joined: Jun 05, 2002
Posts: 3
Please try this

ObjectListField olf = ObjectListField() ;
olf.set(new String[]{"1", "2"});
adroit dhanwada
Greenhorn

Joined: Apr 18, 2007
Posts: 16
Thankyou for the reply.
nope its not working. the error is after calling list.setCallback();,the class implementing the interface ListFieldCallback interface is initialised,then the method :
public void drawListRow(ListField list, Graphics g, int index, int y, int w)
{
String text = (String)listElement.elementAt(index);
g.drawText(text, 0, y, 0, w);
} is being called.
listElement is a java.util.Vector.
here listElement.elementAt(index) is giving ArrayIndexOutOfBoundsException
in the tutorial also the code is exactly like this.
regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ListField arrayindex out of bounds exception
 
Similar Threads
C# for Experienced Programmers by Paul J. Deitel, J. A. Listfield, T. Nieto, Marina Z
Problem with generated types
distribute tokens (cards)..
JS in Firefox works fine but not in IE
Pre render some fields in the DUALLISTFIELD on the other side