sm.addListener(new SessionManager.Listener(){
public void onNewSession(Session s) {
model.addRow(new Object[]{"",s.getId(),"","","",""});
}
public void onRequest(Session s) {
HttpRequest r = s.getRequest();
//method
model.setValueAt(r.getMethod(), s.getId(), 3);
//host
String host = r.getHost();
if(r.getPort()!=80) {
host +=":"+r.getPort();
}
model.setValueAt(host, s.getId(), 4);
//resource
model.setValueAt(r.getRelativeUrl(), s.getId(), 5);
}
public void onResponse(Session s) {
HttpResponse r = s.getResponse();
model.setValueAt(ContentTypeHelper.getImageIcon(r.getHeaders().getHeader("Content-type")), s.getId(), 0);
model.setValueAt(r.getStatusCode(), s.getId(), 2);
}
});
table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {