More chat panel fiddling.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@263 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -71,10 +71,10 @@ public class ChatPanel extends JPanel
|
|||||||
{
|
{
|
||||||
public ChatPanel (CrowdContext ctx)
|
public ChatPanel (CrowdContext ctx)
|
||||||
{
|
{
|
||||||
this(ctx, false);
|
this(ctx, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChatPanel (CrowdContext ctx, boolean cuddleHintLabel)
|
public ChatPanel (CrowdContext ctx, boolean showHintLabel)
|
||||||
{
|
{
|
||||||
// keep this around for later
|
// keep this around for later
|
||||||
_ctx = ctx;
|
_ctx = ctx;
|
||||||
@@ -98,23 +98,19 @@ public class ChatPanel extends JPanel
|
|||||||
createStyles(_text);
|
createStyles(_text);
|
||||||
|
|
||||||
// add a label for the text entry stuff
|
// add a label for the text entry stuff
|
||||||
JLabel hint = new JLabel("Type here to chat:");
|
if (showHintLabel) {
|
||||||
if (!cuddleHintLabel) {
|
add(new JLabel("Type here to chat:"), GroupLayout.FIXED);
|
||||||
add(hint, GroupLayout.FIXED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a horizontal group for the text entry bar
|
// create a horizontal group for the text entry bar
|
||||||
gl = new HGroupLayout(GroupLayout.STRETCH);
|
gl = new HGroupLayout(GroupLayout.STRETCH, GroupLayout.STRETCH, 5, GroupLayout.LEFT);
|
||||||
JPanel epanel = new JPanel(gl);
|
JPanel epanel = new JPanel(gl);
|
||||||
if (cuddleHintLabel) {
|
|
||||||
epanel.add(hint, GroupLayout.FIXED);
|
|
||||||
}
|
|
||||||
epanel.add(_entry = new JTextField());
|
epanel.add(_entry = new JTextField());
|
||||||
_entry.setActionCommand("send");
|
_entry.setActionCommand("send");
|
||||||
_entry.addActionListener(this);
|
_entry.addActionListener(this);
|
||||||
_entry.setEnabled(false);
|
_entry.setEnabled(false);
|
||||||
|
|
||||||
_send = new JButton("Send");
|
_send = new JButton("Chat!");
|
||||||
_send.setEnabled(false);
|
_send.setEnabled(false);
|
||||||
_send.addActionListener(this);
|
_send.addActionListener(this);
|
||||||
_send.setActionCommand("send");
|
_send.setActionCommand("send");
|
||||||
|
|||||||
Reference in New Issue
Block a user