*@param buddy the buddy to associate with
*/
public ChatPanel(final BuddyStatus buddy) {
super(buddy);
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
// create two fields, one for where you type your message to be sent,
// and the other where you see the conversation that has already happened.
textEntryArea.setLineWrap(true);
textEntryArea.setWrapStyleWord(true);
conversationArea.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
container = new JSplitPane(JSplitPane.VERTICAL_SPLIT, conversationArea,
scroll);
container.setResizeWeight(1);
JPanel containerPanel = new JPanel();
containerPanel.setLayout(new BoxLayout(containerPanel, BoxLayout.X_AXIS));
containerPanel.add(container);
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.Y_AXIS));
if (buddy.getUser().indexOf("/") >= 0) {
resourceBox.setEnabled(false);
}
resourceBox.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
selected = (String) resourceBox.getSelectedItem();
}
});
resourceBox.setRenderer(new PresenceComboBoxRenderer());
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
JPanel resourcePanel = new JPanel();
resourcePanel.setLayout(new BoxLayout(resourcePanel, BoxLayout.Y_AXIS));
resourcePanel.add(Box.createVerticalGlue());
resourcePanel.add(resourceBox);
buttonPanel.add(resourcePanel);
typingLabel.setPreferredSize(new Dimension(26, 26));