aboutsummaryrefslogtreecommitdiff
path: root/examples/TestIvySwing.java
diff options
context:
space:
mode:
Diffstat (limited to 'examples/TestIvySwing.java')
-rw-r--r--examples/TestIvySwing.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/examples/TestIvySwing.java b/examples/TestIvySwing.java
index e7a9315..cb3eca5 100644
--- a/examples/TestIvySwing.java
+++ b/examples/TestIvySwing.java
@@ -141,8 +141,8 @@ class TestIvySwing extends JPanel implements IvyApplicationListener {
append(client.getApplicationName() + " disconnected " );
}
- public void die(IvyClient client, int id) {
- append(client.getApplicationName() + " die "+ id );
+ public void die(IvyClient client, int id,String msgarg) {
+ append(client.getApplicationName() + " die "+ id + " " + msgarg);
}
public void directMessage(IvyClient client, int id, String arg) {
@@ -175,9 +175,13 @@ class TestIvySwing extends JPanel implements IvyApplicationListener {
}
regexp=tfRegex.getText();
regexp.trim();
- regexp_id = bus.bindMsg(regexp,this);
- tfRegex.setText("");
- laRegex.setText(regexp);
+ try {
+ regexp_id = bus.bindMsg(regexp,this);
+ tfRegex.setText("");
+ laRegex.setText(regexp);
+ } catch (IvyException ie) {
+ System.out.println("RE error "+regexp); // this should not happen
+ }
}
public void receive(IvyClient client, String[] args) {
String out="client " + client.getApplicationName() + " envoie: [ ";
@@ -194,10 +198,14 @@ class TestIvySwing extends JPanel implements IvyApplicationListener {
int count;
String tosend = tfSend.getText();
tfSend.setText("");
- if ( (count = bus.sendMsg(tosend)) != 0 )
- append("Sending '" + tosend + "' count " + count );
- else
- append("not Sending '" + tosend + "' nobody cares");
+ try {
+ if ( (count = bus.sendMsg(tosend)) != 0 )
+ append("Sending '" + tosend + "' count " + count );
+ else
+ append("not Sending '" + tosend + "' nobody cares");
+ } catch (IvyException ie ) {
+ append("problem Sending '" + tosend + "'");
+ }
}
}