aboutsummaryrefslogtreecommitdiff
path: root/examples/TestIvySwing.java
diff options
context:
space:
mode:
authorjestin2004-07-27 16:21:24 +0000
committerjestin2004-07-27 16:21:24 +0000
commit9ab98e8b79688821f85649fa3a04137f83467b73 (patch)
treeec55f2feb85355cadaf901bd561cd37444ae83ba /examples/TestIvySwing.java
parent9eff9570e518daccec02dd62593294341f4c36b6 (diff)
downloadivy-java-9ab98e8b79688821f85649fa3a04137f83467b73.zip
ivy-java-9ab98e8b79688821f85649fa3a04137f83467b73.tar.gz
ivy-java-9ab98e8b79688821f85649fa3a04137f83467b73.tar.bz2
ivy-java-9ab98e8b79688821f85649fa3a04137f83467b73.tar.xz
clean up the examples to abide to the new API
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 + "'");
+ }
}
}