I generated the code as below,but reset button is not displaying between start and finish buttons

210 views Asked by At

I generated the code as below, but reset button is not displaying between start and finish buttons. Any one help me to display the reset button?

Thanks in advance

final BitmapField mybitmapresetField = new BitmapField(Bitmap.getBitmapResource("res/images/start_button.png"),FOCUSABLE);
protected void sublayout(int maxWidth, int maxHeight) {

                layoutChild( mybitmapstartField, maxWidth, maxHeight);
                setPositionChild( mybitmapstartField, 140, 0);
                layoutChild( mybitmapresetField, maxWidth, maxHeight);
                setPositionChild( mybitmapresetField, 0, 0);

                layoutChild(mybitmapfinishField, maxWidth, maxHeight);
                setPositionChild(mybitmapfinishField, 280, 0);
                layoutChild(mybitmaplogoField, maxWidth, maxHeight);
                setPositionChild(mybitmaplogoField, 20, 440);

                layoutChild( mybitmaphowtoField, maxWidth, maxHeight);
                setPositionChild( mybitmaphowtoField, 140, 440);
                layoutChild( mybitmapm1Field, maxWidth, maxHeight);
                setPositionChild( mybitmapm1Field, 190, 60);
                layoutChild( mybitmapleftyrField, maxWidth, maxHeight);
                setPositionChild( mybitmapleftyrField, 120, 100);
                layoutChild( mybitmaprightyrField, maxWidth, maxHeight);
                setPositionChild( mybitmaprightyrField, 280, 100);
                layoutChild( backgroundBitmapbar1, maxWidth, maxHeight);
                setPositionChild( backgroundBitmapbar1, 10, 140);
                layoutChild( backgroundBitmapbar2, maxWidth, maxHeight);
                setPositionChild( backgroundBitmapbar2, 10, 180);
                layoutChild( backgroundBitmapbar3, maxWidth, maxHeight);
                setPositionChild( backgroundBitmapbar3, 10, 220);
                layoutChild( backgroundBitmapbar4, maxWidth, maxHeight);
                setPositionChild( backgroundBitmapbar4, 10, 260);
                layoutChild( backgroundBitmapbar5, maxWidth, maxHeight);
                setPositionChild( backgroundBitmapbar5, 10, 300);
                layoutChild( backgroundBitmapbar6, maxWidth, maxHeight);
                setPositionChild( backgroundBitmapbar6, 10, 340);

                layoutChild( timerCount , maxWidth, maxHeight);
                setPositionChild( timerCount , 274, 443);
                setExtent(Display.getWidth(),Display.getHeight());

            }

        };
        _vfm.add(mybitmapstartField) ;

        _vfm.add(mybitmapresetField) ;
        _vfm.add(mybitmapfinishField) ;
        _vfm.add(mybitmaplogoField) ;
        _vfm.add(mybitmapm1Field) ;
        _vfm.add(mybitmapleftyrField) ;
        _vfm.add(mybitmaprightyrField) ;
        _vfm.add( mybitmaphowtoField) ;
        _vfm.add(timerCount) ;
        _vfm.add(backgroundBitmapbar1) ;

        _vfm.add(backgroundBitmapbar2) ;
        _vfm.add(backgroundBitmapbar3) ;
        _vfm.add(backgroundBitmapbar4) ;
        _vfm.add(backgroundBitmapbar5) ;
        _vfm.add(backgroundBitmapbar6) ;

    this.add(_vfm);  
    }
1

There are 1 answers

3
Eric Giguere On

You're calling setPositionChild with a 0 coordinate for the reset field, a 140 coordinate for the start field, and a 280 coordinate for the finish field. You need to set the field's coordinate to something between 140 and 280, or else change the other coordinates.