callbackInterface = owner;
panelLeft = new JPanel();
panelLeft.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e)
{
panelRight.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
panelLeft.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
repaint(); isServer = !isServer;
callbackInterface.serverClicked();
}
public void mouseEntered(MouseEvent e)
{ setCursor(new Cursor(Cursor.HAND_CURSOR)); }
public void mouseExited(MouseEvent e)
{ setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }
});
panelLeft.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
add(panelLeft, "1, 1, fill, fill");
panelRight = new JPanel();
panelRight.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e)
{
panelLeft.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
panelRight.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
repaint(); isServer = !isServer;
callbackInterface.clientClicked();
}
public void mouseEntered(MouseEvent e)
{ setCursor(new Cursor(Cursor.HAND_CURSOR)); }
public void mouseExited(MouseEvent e)
{ setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }
});
panelRight.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
add(panelRight, "2, 1, fill, fill");
}