Blackberry 需要现场经理的帮助吗

Blackberry 需要现场经理的帮助吗,blackberry,java-me,Blackberry,Java Me,我一直得到一个IllegalArgumentException,当我运行此代码时,BlackBerry模拟器上没有显示任何内容。有什么问题吗 public MyScreen() { // Set the displayed title of the screen and add the weather icons setTitle("PixWeather"); cityField = new LabelFie

我一直得到一个IllegalArgumentException,当我运行此代码时,BlackBerry模拟器上没有显示任何内容。有什么问题吗

 public MyScreen()
    {        
        // Set the displayed title of the screen and add the weather icons      
        setTitle("PixWeather");

        cityField = new LabelField("Queensland", Field.FIELD_LEFT);
        tempField = new LabelField("17", Field.FIELD_RIGHT);

        condField = new LabelField("sunny",Field.FIELD_RIGHT);

       weather_icon = Bitmap.getBitmapResource("sun_icon.png");
        bitmapField = new BitmapField(weather_icon, Field.FIELD_LEFT);

        VerticalFieldManager vfield = new VerticalFieldManager();


        HorizontalFieldManager hfield1 = new HorizontalFieldManager();
        hfield1.add(cityField);
        hfield1.add(tempField);

        HorizontalFieldManager hfield2 = new HorizontalFieldManager();
        hfield2.add(bitmapField);
        hfield2.add(condField);

        vfield.add(hfield1);
        vfield.add(hfield2);

    }

IllegalArgumentException可能与此无关,但您的屏幕上没有显示任何内容,因为您没有向屏幕添加任何内容

您需要将vfield添加到屏幕本身。添加以下行:

add(vfield);

步骤1是找出IllegalArgumentException抛出的位置。进行一些调试以找出答案,然后用您的发现更新此问题。谢谢您的回答。我尝试了您的建议,但我一直收到一条消息,源文件找不到,我应该打开“调试透视图”窗口。不知道怎么了。很抱歉打扰您,但是对于Blackberry的开发来说还是比较陌生的。我认为您应该尝试另一个模拟器,或者在启动之前在模拟器上擦除数据(JDE中的文件菜单)。你需要摆脱任何其他应用程序抛出的异常。当您试图进行适当的开发时,在代码中遇到您无权访问的异常情况不是一个好情况。此外,进入“调试”菜单,取消选中任何表示您应该在愚蠢的事情上(如内存分配)进入调试模式的选项。