Package com.sun.dtv.lwuit

Examples of com.sun.dtv.lwuit.Button


        mainForm = new Form();
        mainForm.setLayout(new CoordinateLayout(200, 480));
        mainForm.setY(130);
        mainForm.setX(0);
        // Create buttons in the main form
        final Button btnLoadXlet = new Button("Carregar um Xlet");
        btnLoadXlet.setX(5);
        btnLoadXlet.setY(0);
        btnLoadXlet.setWidth(150);

        final Button btnVideo = new Button("Tocar um video");
        btnVideo.setX(5);
        btnVideo.setY(35);
        btnVideo.setWidth(150);

        final Button btnSair = new Button("Sair");
        btnSair.setX(5);
        btnSair.setY(70);
        btnSair.setWidth(150);

        final Label lblIP = new Label("Voce pode conectar por ssh usando: root@" + Info.getIpAddress());
        lblIP.setX(40);
        lblIP.setY(305);
        lblIP.setWidth(150);

        // Criando actionListener
        ActionListener listener = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
               
                if (evt.getSource() == btnLoadXlet) {
                    loadForm.show();
                    mainForm.setVisible(true);
                    //mainForm.setY(100);
                    //btnSair.setVisible(false);
                    //mainForm.repaint();
                } else if (evt.getSource() == btnVideo) {
                    videoForm.show();
                    mainForm.setVisible(true);
                } else if (evt.getSource() == btnSair) {
                    exit();
                }
            }
        };

        // Adicionando actionListeners
        btnLoadXlet.addActionListener(listener);
        btnVideo.addActionListener(listener);
        btnSair.addActionListener(listener);
        mainForm.addComponent(btnLoadXlet);
        mainForm.addComponent(btnVideo);
        mainForm.addComponent(btnSair);
        mainForm.addComponent(lblIP);
        mainForm.setCommandListener(listener);
View Full Code Here


        Style stylebotao = new Style();
        stylebotao.setBgColor(0x000000, true);
        stylebotao.setBgSelectionColor(0x090909, true);
        list.setStyle(stylebotao);

        final Button btnLoadXlet = new Button("Carregar >>");
        btnLoadXlet.setY(143);
        btnLoadXlet.setX(160);
        final Button btnVoltar = new Button("<< Voltar");
        btnVoltar.setY(143);
        btnVoltar.setX();

        // Criando actionListener
        ActionListener listener = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                if (evt.getSource() == btnLoadXlet) {
                    context.notifyPaused();
                    ApplicationManager.loadXlet("/home/mos/xlets/" + (String)list.getSelectedItem());
                } else if (evt.getSource() == btnVoltar) {
                    loadForm.setVisible(false);
                    mainForm.show();

                }
            }
        };

        // Adicionando actionListeners
        btnLoadXlet.addActionListener(listener);
        btnVoltar.addActionListener(listener);

        loadForm.addComponent(lblStatus);
        loadForm.addComponent(list);
        loadForm.addComponent(btnLoadXlet);
        loadForm.addComponent(btnVoltar);
View Full Code Here

        Style stylebotao = new Style();
        stylebotao.setBgColor(0x000000, true);
        stylebotao.setBgSelectionColor(0x090909, true);
        list.setStyle(stylebotao);

        final Button btnLoadXlet = new Button("Carregar >>");
        btnLoadXlet.setY(143);
        btnLoadXlet.setX(160);
        final Button btnVoltar = new Button("<< Voltar");
        btnVoltar.setY(143);
        btnVoltar.setX(0);

        // Criando actionListener
        ActionListener listener = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                //System.out.println("A��o!");
                if (evt.getSource() == btnVoltar) {
                    videoForm.setVisible(false);
                    mainForm.show();
                } else if (evt.getSource() == btnLoadXlet) {
                    MPlayer.openfile("/home/mos/zvideos/" + (String)list.getSelectedItem());
                }
            }
        };

        // Adicionando actionListeners
        btnLoadXlet.addActionListener(listener);
        btnVoltar.addActionListener(listener);
        videoForm.addComponent(lblStatus);
        videoForm.addComponent(list);
        videoForm.addComponent(btnLoadXlet);
        videoForm.addComponent(btnVoltar);
    }
View Full Code Here

        mainForm.setX(0);
        mainForm.setY(0);
        mainForm.setWidth(300);
        mainForm.setHeight(300);
        //Sair
        final Button btnSair = new Button("Sair");
        btnSair.setX(0);
        btnSair.setY(22);
        // Create buttons in the main form
        final Label lblHello = new Label("Hello LWUIT");

        ActionListener listener = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                    if (evt.getSource() == btnSair) {
                    exit();
                }


            }
        };

        btnSair.addActionListener(listener);
        mainForm.addComponent(lblHello);
        mainForm.addComponent(btnSair);
        mainForm.setCommandListener(listener);

        return mainForm;
View Full Code Here

TOP

Related Classes of com.sun.dtv.lwuit.Button

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.