Use AncestorAdapter.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@779 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ChatPanel.java,v 1.8 2001/12/14 04:33:53 shaper Exp $
|
||||
// $Id: ChatPanel.java,v 1.9 2001/12/14 16:07:30 shaper Exp $
|
||||
|
||||
package com.threerings.micasa.client;
|
||||
|
||||
@@ -17,7 +17,6 @@ import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.JTextPane;
|
||||
import javax.swing.event.AncestorEvent;
|
||||
import javax.swing.event.AncestorListener;
|
||||
import javax.swing.text.BadLocationException;
|
||||
import javax.swing.text.Document;
|
||||
import javax.swing.text.Style;
|
||||
@@ -27,6 +26,7 @@ import javax.swing.text.StyleContext;
|
||||
import com.samskivert.swing.GroupLayout;
|
||||
import com.samskivert.swing.HGroupLayout;
|
||||
import com.samskivert.swing.VGroupLayout;
|
||||
import com.samskivert.swing.event.AncestorAdapter;
|
||||
|
||||
import com.threerings.crowd.chat.ChatCodes;
|
||||
import com.threerings.crowd.chat.ChatDirector;
|
||||
@@ -86,18 +86,12 @@ public class ChatPanel
|
||||
add(epanel, GroupLayout.FIXED);
|
||||
|
||||
// listen to ancestor events to request focus when added
|
||||
addAncestorListener(new AncestorListener() {
|
||||
addAncestorListener(new AncestorAdapter() {
|
||||
public void ancestorAdded (AncestorEvent e) {
|
||||
if (_focus) {
|
||||
_entry.requestFocus();
|
||||
}
|
||||
}
|
||||
public void ancestorMoved (AncestorEvent e) {
|
||||
// don't care
|
||||
}
|
||||
public void ancestorRemoved (AncestorEvent e) {
|
||||
// don't care
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: LobbySelector.java,v 1.3 2001/10/11 04:13:33 mdb Exp $
|
||||
// $Id: LobbySelector.java,v 1.4 2001/12/14 16:07:30 shaper Exp $
|
||||
|
||||
package com.threerings.micasa.lobby;
|
||||
|
||||
@@ -11,8 +11,8 @@ import java.util.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.AncestorEvent;
|
||||
import javax.swing.event.AncestorListener;
|
||||
|
||||
import com.samskivert.swing.event.AncestorAdapter;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.crowd.data.PlaceObject;
|
||||
@@ -67,16 +67,12 @@ public class LobbySelector
|
||||
|
||||
// we'll need to know when we are made visible because we'll want
|
||||
// to issue a request for our categories when that happens
|
||||
addAncestorListener(new AncestorListener () {
|
||||
addAncestorListener(new AncestorAdapter () {
|
||||
public void ancestorAdded (AncestorEvent evt) {
|
||||
// issue a get categories request to get the category list
|
||||
LobbyService.getCategories(
|
||||
_ctx.getClient(), LobbySelector.this);
|
||||
}
|
||||
public void ancestorRemoved (AncestorEvent evt) {
|
||||
}
|
||||
public void ancestorMoved (AncestorEvent evt) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user