BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-08-2010, 07:42 AM   #1 (permalink)
New Member
 
SergioTapia's Avatar
 
Join Date: Aug 2010
Model: 7100T
PIN: N/A
Carrier: asdfasdf
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Why am I getting IndexOutOfBounds exceptions here?

Please Login to Remove!

I've done practically nothing on the application and I get this error. Why?

Thanks for the help!

Code:
import javax.microedition.lcdui.Display;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.Ui;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.BasicEditField;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.component.SeparatorField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.decor.Background;
import net.rim.device.api.ui.decor.BackgroundFactory;

public class ExpenseManager extends UiApplication {
	public static void main(String[] args) {
		ExpenseManager theApp = new ExpenseManager();
		theApp.enterEventDispatcher();
	}

	public ExpenseManager() {
		pushScreen(new GeneralExpenseViewScreen());
	}
}

final class GeneralExpenseViewScreen extends MainScreen {
	public GeneralExpenseViewScreen() {
		super();
		LabelField title = new LabelField("TeamMate TEC | Expenses",
				LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
		setTitle(title);
		
		Background bg = BackgroundFactory.createSolidBackground(0xBDBDDB);
		setBackground(bg);
		
		HorizontalFieldManager headerAreaManager = new HorizontalFieldManager();
		HorizontalFieldManager filterAreaManager = new HorizontalFieldManager() {
			protected void sublayout(int width, int height) {
				setExtent(360, 95);
			}
		};
		HorizontalFieldManager expenseListAreaManager = new HorizontalFieldManager() {
			protected void sublayout(int width, int height) {
				setExtent(360, 200);
			}
		};		
		HorizontalFieldManager totalAreaManager = new HorizontalFieldManager() {
			protected void sublayout(int width, int height) {
				setExtent(360, 45);
			}
		};
		HorizontalFieldManager addNewAreaManager = new HorizontalFieldManager() {
			protected void sublayout(int width, int height) {
				setExtent(360, 103);
			}
		};
		
		filterAreaManager.setBackground(bg);
		expenseListAreaManager.setBackground(bg);
		totalAreaManager.setBackground(bg);
		addNewAreaManager.setBackground(bg);
		
		add(headerAreaManager);
		add(filterAreaManager);
		add(expenseListAreaManager);
		add(totalAreaManager);
		add(addNewAreaManager);
		
		/**Begin form layouts**/
		
		Bitmap headerImage = Bitmap.getBitmapResource("sergioheader.png");
		BitmapField header = new BitmapField(headerImage);
		headerAreaManager.add(header);
		
	}

	public boolean onClose() {
		Dialog.alert("AH!");
		System.exit(0);
		return true;
	}
}

Edit: Just tried out creating a VerticalFieldManager using the same code as above and I do not get the errors...Why is this? Thanks.

Last edited by SergioTapia : 09-08-2010 at 08:02 AM.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

10Pcs 16Mhz 16.000Mhz 16M Hz Crystal Oscillator Hc-49S New Ic C
$0.99
10Pcs 16Mhz 16.000Mhz 16M Hz Crystal Oscillator Hc-49S New Ic C picture100 Pack - 5" x 7" Crystal Clear Resealable Reclosable Cello / Cellophane Bags,
$8.25
100 Pack - 5MICRO-ABRADER SYSTEM- CRYSTAL MARK
$0.99
MICRO-ABRADER SYSTEM- CRYSTAL MARK picture419 X NDK NX5032GA-12.000000MHZ CRYSTAL 12.0000MHZ 8PF SMD
$79.9
419 X NDK NX5032GA-12.000000MHZ CRYSTAL 12.0000MHZ 8PF SMD pictureCrystal Clear 200-Pieces Universal Thermal Laminating Pouches Rounded Corners
$23.24
Crystal Clear 200-Pieces Universal Thermal Laminating Pouches Rounded Corners picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.