Package com.sun.lwuit

Examples of com.sun.lwuit.Button


      getGuiOnlineMenu();
     
     
    }
    else if (id == Contents.ok) {
            Button b;
            try {
                b = (Button)conv_list.getFocused();
            } catch (Exception e) {
                return;
            }

      String text = b.getText();
      if (text.equals(Contents.rosterChoices[0])) { //Change
        getGuiRosterDetails();
        internal_state = ROSTER_DETAILS;
      }
      else if (text.equals(Contents.rosterChoices[1])) { //delete
View Full Code Here


    else {
      res.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
      Image[] img = new Image[]{Contents.displayImage("connected"), Contents.displayImage("unsubscribed")};
      ButtonActionListener action = new ButtonActionListener();
      for (int k=0; k<Contents.judChoices.length; k++) {
            Button b = new Button(Contents.judChoices[k], img[k]);
              b.getStyle().setBgTransparency(100);
              b.setTextPosition(Button.RIGHT);
              b.addActionListener(action);
              res.addComponent(b);
          }
     
      if (infopool.containsKey("jud_message"))
      {
View Full Code Here

        infopool.put("jud_message", "Request executed");
        getGuiJudMenu();
      }
      else if (infopool.get("jud_form") != null){ //default menu
        Form res = (Form)infopool.remove("jud_form");
        Button b = (Button)res.getFocused(); //try catch?
        //int ind = jud_list.getSelectedIndex();
        if (b.getText().equals(Contents.judChoices[0]))
          infopool.put("register", "reg");
        else 
          infopool.put("search", "sea");
        getGuiJudMenu();
      }
View Full Code Here

        if (j > 0) {
          text.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
          text.addComponent(new MyTextArea(m.substring(0, j), 0,j));
        }
        j = j + 5;
        Button link = new Button(m.substring(j, k));
        link.getStyle().setBgTransparency(100);
        link.getStyle().setBorder(Border.createEmpty()); //no border
        link.addActionListener(new ButtonActionListener());
        text.addComponent(link); k = k + 5;
        if (k < m.length()-1)
          text.addComponent(new MyTextArea(m.substring(k, m.length()), 0, 100));
     

      }
      else if (j == -1 && p == -1) {
       
        MyTextArea t = new MyTextArea(m, 0,50);
        t.setEnabled(true);
        text.addComponent(t);
      }

           
      conversationForm.addComponent(text);
    }
   
    //if it is multi chat
    if (currentConversation.isMulti) {
      //conversationForm.append(new util.CustomSpacer(conversationForm.getWidth()));
    //  res.append("Room Members: ");
     
     
      Container multi = new Container();
      multi.setLayout(new BorderLayout());
      multi.addComponent(BorderLayout.NORTH,new MyLabel("Room Members:"));
     
      GroupChat chat = (GroupChat)Datas.multichat.get(currentConversation.name);
      //conversationForm.append(new util.CustomStringItem("Room Members:", /*chat.jids,*/ conversationForm.getWidth()));
      Container friends = new Container()
      for (int j=0; j<chat.jids.size(); j++){
       
        String temp = (String)chat.jids.elementAt(j);
        if (temp.equals(currentConversation.name))
          continue;
        else if (temp.indexOf('@') != -1)
          friends.addComponent(new Label(temp.substring(0, temp.indexOf('@'))));
        else
          friends.addComponent(new Label(temp));
      }
      multi.addComponent(BorderLayout.CENTER, friends);
      //conversationForm.append(new util.CustomSpacer(conversationForm.getWidth()));
      TextField tf1 = new TextField(Contents.invite_textbox, 64);
     
     
      infopool.put("invite", tf1);

      multi.addComponent(BorderLayout.SOUTH, tf1);
     
      conversationForm.addComponent(multi);
    }
   
    Button his = new Button("Show History");
    his.getStyle().setBgTransparency(100);
    his.getStyle().setBorder(Border.createEmpty());
    his.addActionListener(new ButtonActionListener());
    conversationForm.addComponent(his);
    //his.addCommand(Contents.history);
   
    //TODO: se mettessimo un tastino send sotto la textarea?
   
View Full Code Here

            if (j > 0) {
              text.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
              text.addComponent(new MyTextArea(m.substring(0, j), 0,j));
            }
            j = j + 5;
            Button link = new Button(m.substring(j, k));
            link.getStyle().setBgTransparency(100);
            link.getStyle().setBorder(Border.createEmpty()); //no border
            link.addActionListener(new ButtonActionListener());
            text.addComponent(link); k = k + 5;
            if (k < m.length()-1)
              text.addComponent(new MyTextArea(m.substring(k, m.length()), 0, 100));
         

          }
          else if (j == -1 && p == -1) {
            //txt.setText(m);
            MyTextArea t = new MyTextArea(m, 0,50);
            t.setEnabled(true);
            text.addComponent(t);
          }
               
          conversationForm.addComponent(text);
        }
       
        //if it is multi chat
        if (currentConversation.isMulti) {
          //conversationForm.append(new util.CustomSpacer(conversationForm.getWidth()));
        //  res.append("Room Members: ");
         
         
          Container multi = new Container();
          multi.setLayout(new BorderLayout());
          multi.addComponent(BorderLayout.NORTH,new MyLabel("Room Members:"));
         
          GroupChat chat = (GroupChat)Datas.multichat.get(currentConversation.name);
          //conversationForm.append(new util.CustomStringItem("Room Members:", /*chat.jids,*/ conversationForm.getWidth()));
          Container friends = new Container()
          for (int j=0; j<chat.jids.size(); j++){
           
            String temp = (String)chat.jids.elementAt(j);
            if (temp.equals(currentConversation.name))
              continue;
            else if (temp.indexOf('@') != -1)
              friends.addComponent(new Label(temp.substring(0, temp.indexOf('@'))));
            else
              friends.addComponent(new Label(temp));
          }
          multi.addComponent(BorderLayout.CENTER, friends);
          //conversationForm.append(new util.CustomSpacer(conversationForm.getWidth()));
          TextField tf1 = new TextField(Contents.invite_textbox, 64);
          //mainForm.addCommand(Contents.invite);
         
          infopool.put("invite", tf1);

          multi.addComponent(BorderLayout.SOUTH, tf1);
         
          conversationForm.addComponent(multi);
        }
       
        Button his = new Button("Show History");
        his.getStyle().setBgTransparency(100);
        his.getStyle().setBorder(Border.createEmpty());
        his.addActionListener(new ButtonActionListener());
        conversationForm.addComponent(his);
        //his.addCommand(Contents.history);
       
        //TODO: se mettessimo un tastino send sotto la textarea?
        mainForm.addCommand(Contents.send, 0);
View Full Code Here

TOP

Related Classes of com.sun.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.