Skip to content

Commit

Permalink
fixing borders and adding colours
Browse files Browse the repository at this point in the history
  • Loading branch information
maandree committed Apr 18, 2012
1 parent c789b79 commit 582eb23
Showing 1 changed file with 38 additions and 12 deletions.
50 changes: 38 additions & 12 deletions src/cnt/interfaces/gui/UserList.java
@@ -1,36 +1,62 @@
/**
* Coop Network Tetris — A cooperative tetris over the Internet.
*
* Copyright Ⓒ 2012 Mattias Andrée, Peyman Eshtiagh,
* Calle Lejdbrandt, Magnus Lundberg
*
* Project for prutt12 (DD2385), KTH.
*/
package cnt.interfaces.gui;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;


/**
* Player list panel
*
* @author Peyman Eshtiagh
* @author Mattias Andrée, <a href="mailto:maandree@kth.se">maandree@kth.se</a>
*/
public class UserList extends JPanel
{
/**
* Constructor
*/
public UserList()
{
setLayout(new BorderLayout());
model = new DefaultListModel();
list = new JList(model);
this.setLayout(new BorderLayout());

JScrollPane pane = new JScrollPane(list);
model.addElement("Peyman");
model.addElement("Calle");
model.addElement("Magnus");
model.addElement("Mattias");
this.model = new DefaultListModel();
this.list = new JList(model);

add(pane, BorderLayout.NORTH);
final JScrollPane pane = new JScrollPane(this.list);
this.model.addElement("<html><span style=\"color: rgb(0, 255, 0);\">Peyman</span></html>");
this.model.addElement("<html><span style=\"color: rgb(255, 255, 0);\">Calle</span></html>");
this.model.addElement("<html><span style=\"color: rgb(255, 0, 0);\">Magnus</span></html>");
this.model.addElement("<html><span style=\"color: rgb(0, 0, 255);\">Mattias</span></html>");

LookAndFeel.installBorder(pane, "BorderFactory.createEmptyBorder()");

this.add(pane, BorderLayout.CENTER);

this.setBackground(Color.BLACK);
pane.setBackground(Color.BLACK);
list.setBackground(Color.BLACK);
this.list.setBackground(Color.BLACK);
}



JList list;
/**
* The list component
*/
private final JList list;

DefaultListModel model;
/**
* The list's model
*/
private final DefaultListModel model;

}

0 comments on commit 582eb23

Please sign in to comment.