Package mdes.slick.sui

Examples of mdes.slick.sui.Button


    m_name.setFont(GameClient.getFontSmall());
    m_name.setForeground(Color.white);
    m_name.pack();
    m_name.setLocation(0,0);
    getContentPane().add(m_name);
    m_remove = new Button("Remove");
    m_remove.setSize(100,25);
    m_remove.setLocation(0, m_name.getY() + m_name.getTextHeight() + 3);
    getContentPane().add(m_remove);
    m_whisper = new Button("Whisper");
    m_whisper.setSize(100,25);
    m_whisper.setLocation(0, m_remove.getY() + m_remove.getHeight());
    m_whisper.setEnabled(online);
    getContentPane().add(m_whisper);
    m_cancel = new Button("Cancel");
    m_cancel.setSize(100,25);
    m_cancel.setLocation(0, m_whisper.getY() + m_cancel.getHeight());
    getContentPane().add(m_cancel);
    setBackground(new Color(0,0,0,150));
    setSize(100, 103 + m_name.getTextHeight());
View Full Code Here


    m_passLabel.setVisible(true);
    m_passLabel.setFont(GameClient.getFontSmall());
    m_passLabel.setForeground(m_white);
    this.add(m_passLabel);
   
    m_login = new Button(translated.get(7));
    m_login.setSize(64, 32);
    m_login.setLocation(m_password.getX(), m_password.getY() + m_password.getHeight() + 8);
    m_login.setVisible(true);
    m_login.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        if(m_username.getText() != null & !m_username.getText().equalsIgnoreCase("") &&
            m_password.getText() != null && !m_password.getText().equalsIgnoreCase("")) {
          login();
        }
      }
    });
    this.add(m_login);
   
    m_register = new Button(translated.get(8));
    m_register.setSize(64, 32);
    m_register.setLocation(m_login.getX() + m_login.getWidth() + 8, m_login.getY());
    m_register.setVisible(true);
    m_register.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
View Full Code Here

  private void initGUI(){
    m_ourPokes = new ToggleButton[6];
    m_theirPokes = new ToggleButton[6];
    m_theirPokeInfo = new PokemonInfoDialog[6];
    m_ourMoneyOffer = new TextField();
    m_makeOfferBtn = new Button();
    m_tradeBtn = new Button();
    m_cancelBtn = new Button();
   
    //Action Listener for the offer button
    m_offerListener = new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        if (m_makeOfferBtn.getText().equalsIgnoreCase("Make Offer")){
View Full Code Here

    bagicon.setLocation(18, 0);
    bagicon.setFont(GameClient.getFontLarge());
    getContentPane().add(bagicon);

    // Scrolling Button LEFT
    m_leftButton = new Button("<");
    m_leftButton.setSize(20, 40);
    m_leftButton.setLocation(15, 95);
    m_leftButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        destroyPopup();
        int i = m_scrollIndex.get(m_curCategory) - 1;
        m_scrollIndex.remove(m_curCategory);
        m_scrollIndex.put(m_curCategory, i);
        m_update = true;
      }
    });
    getContentPane().add(m_leftButton);

    // Item Buttons and Stock Labels
    for (int i = 0; i < 4; i++) {
      final int j = i;
      // Starts the item buttons
      Button item = new Button();
      item.setSize(60, 60);
      item.setLocation(50 + (80 * i), 85);
      item.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          destroyPopup();
          useItem(j);
        }
      });
      m_itemBtns.add(item);
      getContentPane().add(item);

      // Starts the item labels
      Label stock = new Label();
      stock.setSize(60, 40);
      stock.setLocation(50 + (80 * i), 135);
      stock.setHorizontalAlignment(Label.CENTER_ALIGNMENT);
      stock.setFont(GameClient.getFontLarge());
      stock.setForeground(Color.white);
      m_stockLabels.add(stock);
      getContentPane().add(stock);
    }

    // Scrolling Button Right
    m_rightButton = new Button(">");
    m_rightButton.setSize(20, 40);
    m_rightButton.setLocation(365, 95);
    m_rightButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        destroyPopup();
        int i = m_scrollIndex.get(m_curCategory) + 1;
        m_scrollIndex.remove(m_curCategory);
        m_scrollIndex.put(m_curCategory, i);
        m_update = true;
      }
    });
    getContentPane().add(m_rightButton);

    // Close Button
    m_cancel = new Button("Close");
    m_cancel.setSize(400, 32);
    m_cancel.setLocation(0, 195);
    m_cancel.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        destroyPopup();
View Full Code Here

    m_name.pack();
    m_name.setLocation(0,0);
    getContentPane().add(m_name);
   
    // Use button
    m_use = new Button("Use");
    m_use.setSize(100,25);
    m_use.setLocation(0, m_name.getY() + m_name.getHeight() + 3);
    m_use.addActionListener(new ActionListener(){
      public void actionPerformed (ActionEvent e){
        useItem(m_id, m_useOnPoke, m_isBattle);
      }
    });
    getContentPane().add(m_use);

    if (!isBattle){
      m_give = new Button("Give");
      m_give.setSize(100,25);
      m_give.setLocation(0, m_use.getY() + 25);
      m_give.setEnabled(false);
      m_give.addActionListener(new ActionListener(){
        public void actionPerformed (ActionEvent e){
          giveItem(m_id);
        }
      });
      getContentPane().add(m_give);
    }
    // Destroy the item
    m_destroy = new Button("Drop");
    m_destroy.setSize(100,25);
    if (!isBattle)
      m_destroy.setLocation(0, m_give.getY() + 25);
    else
      m_destroy.setLocation(0, m_use.getY() + 25);
    m_destroy.addActionListener(new ActionListener(){
      public void actionPerformed (ActionEvent e){
        GameClient.getInstance().getPacketGenerator().writeTcpMessage("i" + m_id);
        destroyPopup();
      }
    });
    getContentPane().add(m_destroy);
   
    // Close the popup
    m_cancel = new Button("Cancel");
    m_cancel.setSize(100,25);
    m_cancel.setLocation(0, m_destroy.getY() + 25);
    m_cancel.addActionListener(new ActionListener(){
      public void actionPerformed (ActionEvent e){
        destroyPopup();
View Full Code Here

        stream = new FileInputStream(respath+"res/servers.txt");
      }
          BufferedReader in = new BufferedReader(new InputStreamReader(stream));

     
      m_servers[0] = new Button(in.readLine());
      m_servers[0].setSize(280, 24);
      m_servers[0].setLocation(16, 32);
      m_servers[0].setVisible(true);
      m_servers[0].addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          GameClient.setHost(m_host[0]);
        }
      });
      this.add(m_servers[0]);
      m_host[0] = in.readLine();
     
      m_servers[1] = new Button(in.readLine());
      m_servers[1].setSize(280, 24);
      m_servers[1].setLocation(16, 64);
      m_servers[1].setVisible(true);
      m_servers[1].addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          GameClient.setHost(m_host[1]);
        }
      });
      this.add(m_servers[1]);
      m_host[1] = in.readLine();
     
      m_servers[2] = new Button(in.readLine());
      m_servers[2].setSize(280, 24);
      m_servers[2].setLocation(16, 96);
      m_servers[2].setVisible(true);
      m_servers[2].addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          GameClient.setHost(m_host[2]);
        }
      });
      this.add(m_servers[2]);
      m_host[2] = in.readLine();
     
      m_servers[3] = new Button(in.readLine());
      m_servers[3].setSize(280, 24);
      m_servers[3].setLocation(16, 128);
      m_servers[3].setVisible(true);
      m_servers[3].addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          GameClient.setHost(m_host[3]);
        }
      });
      this.add(m_servers[3]);
      m_host[3] = in.readLine();
     
      m_servers[4] = new Button(in.readLine());
      m_servers[4].setSize(280, 24);
      m_servers[4].setLocation(16, 160);
      m_servers[4].setVisible(true);
      m_servers[4].addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          GameClient.setHost(m_host[4]);
        }
      });
      this.add(m_servers[4]);
      m_host[4] = in.readLine();
     
      /*
       * Finally, check which servers don't exist and disable their buttons
       */
      for(int i = 0; i < 5; i++) {
        if(m_host[i].equalsIgnoreCase("-")) {
          m_servers[i].setEnabled(false);
          m_host[i] = "";
        }
        m_servers[i].setForeground(m_black);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    privateIP = new TextField();
    privateIP.setLocation(16, 204);
    privateIP.setSize(128, 24);
    this.add(privateIP);
   
    privateServer = new Button();
    privateServer.setText(translate.get(2));
    privateServer.setSize(128, 24);
    privateServer.setLocation(168, 204);
    privateServer.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
View Full Code Here

      m_disableWeather.setLocation(10, 78);
      m_disableWeather.setSelected(Boolean.parseBoolean(m_options.get("disableWeather")));
      getContentPane().add(m_disableWeather);
    }
    {
      m_save = new Button(translated.get(18));
      m_save.setSize(50, 25);
      m_save.setLocation(88, 108);
      getContentPane().add(m_save);

      m_save.addActionListener(new ActionListener() {
View Full Code Here

  }

  public void initUse() {
    final SpriteChooserDialog thisDialog = this;

    Button use = new Button("Use new sprite!");
    use.pack();
    use.setLocation(130, 245);
    getContentPane().add(use);

    Button cancel = new Button("Cancel");
    cancel.pack();
    cancel.setLocation(130, 280);
    getContentPane().add(cancel);

    cancel.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        GameClient.getInstance().getDisplay().remove(thisDialog);
      }
    });
View Full Code Here

    endPane = new Container();
    endPane.setBackground(new Color(0, 0, 0, 0));
    getContentPane().add(endPane);
    endPane.setBounds(0, 154, 253, 192);

    close = new Button();
    close.setVisible(true);
    endPane.add(close);
    close.setText("Close");
    close.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
View Full Code Here

      this.add(m_about);
     
      m_terms = new ToSDialog();
      this.add(m_terms);
     
      m_openAbout = new Button(translated.get(3));
      m_openAbout.setSize(64, 32);
      m_openAbout.setLocation(800 - 64 - 8, 8);
      m_openAbout.setVisible(false);
      m_openAbout.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          showAbout();
        }
      });
      this.add(m_openAbout);
     
      m_openToS = new Button(translated.get(4));
      m_openToS.setSize(64, 32);
      m_openToS.setLocation(800 - 64 - 8, 40);
      m_openToS.setVisible(false);
      m_openToS.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
View Full Code Here

TOP

Related Classes of mdes.slick.sui.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.