lwuit video component floats over commands

75 views Asked by At

My LWUIT video component floats over my commands. Any idea how I can fix this? My code is below.

public void showQuickProfileForm() {
 Form f = new Form();
        VideoComponent videoComponent = null;
        try {
            videoComponent = VideoComponent.createVideoPeer("capture://image");
        } catch (IOException e) {
          //  e.printStackTrace();
            try {
                videoComponent = VideoComponent.createVideoPeer("capture://video");
            } catch (IOException ex) {
              //  ex.printStackTrace();
            }
        }
        videoComponent.setPreferredH((int) (Display.getInstance().getDisplayHeight() * 0.8));
        videoComponent.setPreferredW(Display.getInstance().getDisplayWidth());
        Player player = (Player) videoComponent.getNativePeer();
        try {
            player.realize();
            player.start();
        } catch (MediaException ex) {
            ex.printStackTrace();
        }
        VideoControl videoControl = (VideoControl) player.getControl("VideoControl");
        videoComponent.start();
        f.addComponent(videoComponent);
        f.addCommand(new Command("capture", 1));
        f.show();
    }

    public void actionPerformed(ActionEvent evt) {
        if (evt.getCommand().getId() == 1) {
            // midlet.destroyApp(true);
            Form d = new Form();
            d.show();
        }
    }
1

There are 1 answers

0
Ajibola On

Use this after initializing video control, change width and height as you see fit :

videoControl.setDisplaySize(width + 4, height - 25);