コード例 #1
0
  /** Constructs the <tt>AuthenticationWindow</tt>. */
  private void init() {
    this.idValue =
        new JTextField(
            chatRoom.getParentProvider().getProtocolProvider().getAccountID().getUserID());

    this.infoTextArea.setOpaque(false);
    this.infoTextArea.setLineWrap(true);
    this.infoTextArea.setWrapStyleWord(true);
    this.infoTextArea.setFont(infoTextArea.getFont().deriveFont(Font.BOLD));
    this.infoTextArea.setEditable(false);
    this.infoTextArea.setText(
        GuiActivator.getResources()
            .getI18NString(
                "service.gui.CHAT_ROOM_REQUIRES_PASSWORD",
                new String[] {chatRoom.getChatRoomName()}));

    this.idLabel.setFont(idLabel.getFont().deriveFont(Font.BOLD));
    this.passwdLabel.setFont(passwdLabel.getFont().deriveFont(Font.BOLD));

    this.labelsPanel.add(idLabel);
    this.labelsPanel.add(passwdLabel);

    this.textFieldsPanel.add(idValue);
    this.textFieldsPanel.add(passwdField);

    this.buttonsPanel.add(loginButton);
    this.buttonsPanel.add(cancelButton);

    this.mainPanel.add(infoTextArea, BorderLayout.NORTH);
    this.mainPanel.add(labelsPanel, BorderLayout.WEST);
    this.mainPanel.add(textFieldsPanel, BorderLayout.CENTER);
    this.mainPanel.add(buttonsPanel, BorderLayout.SOUTH);

    this.backgroundPanel.add(mainPanel, BorderLayout.CENTER);

    this.loginButton.setName("ok");
    this.cancelButton.setName("cancel");

    this.loginButton.setMnemonic(GuiActivator.getResources().getI18nMnemonic("service.gui.OK"));
    this.cancelButton.setMnemonic(
        GuiActivator.getResources().getI18nMnemonic("service.gui.CANCEL"));

    this.loginButton.addActionListener(this);
    this.cancelButton.addActionListener(this);

    this.getRootPane().setDefaultButton(loginButton);

    this.setTransparent(true);
  }
コード例 #2
0
    public Component getTableCellRendererComponent(
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
      ChatRoomWrapper chatRoom = (ChatRoomWrapper) value;

      this.setText(chatRoom.getChatRoomName());

      Image chatRoomImage = ImageLoader.getImage(ImageLoader.CHAT_ROOM_16x16_ICON);

      if (chatRoom.getChatRoom() == null || !chatRoom.getChatRoom().isJoined()) {
        chatRoomImage = LightGrayFilter.createDisabledImage(chatRoomImage);
      }

      this.setIcon(new ImageIcon(chatRoomImage));

      this.setFont(this.getFont().deriveFont(Font.PLAIN));

      if (isSelected) this.setBackground(table.getSelectionBackground());
      else this.setBackground(UIManager.getColor("Table.background"));

      return this;
    }