diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Makefile | 2 | ||||
-rw-r--r-- | examples/TestIvySwing.java | 17 |
2 files changed, 7 insertions, 12 deletions
diff --git a/examples/Makefile b/examples/Makefile index c9e6206..2deae23 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -4,7 +4,7 @@ JAVACOPTS = -deprecation .SUFFIXES: .java .class SRCS = TestIvy.java TestIvySwing.java Counter.java ivyTranslater.java OBJS = $(SRCS:.java=.class) - JAVAC = jikes + JAVAC = jikes -classpath $(JIKESPATH) -d . #JAVAC = javac .java.class: diff --git a/examples/TestIvySwing.java b/examples/TestIvySwing.java index 1d5a25a..ddc199d 100644 --- a/examples/TestIvySwing.java +++ b/examples/TestIvySwing.java @@ -53,6 +53,8 @@ class TestIvySwing extends JPanel implements IvyApplicationListener { domainList.add(startDomainList[i]); } + Ivy getBus() { return bus; } + public static void main(String[] args) throws IvyException { String domain="127.255.255.255:2010"; Getopt opt = new Getopt("Counter",args,"b:dhq"); @@ -146,16 +148,10 @@ class TestIvySwing extends JPanel implements IvyApplicationListener { private class ComboCB implements ActionListener { public void actionPerformed(ActionEvent e) { String newDomain=(String)ports.getSelectedItem(); - if (newDomain == domain) { - // if it's the same domain, don't do anything - return; - } + // if it's the same domain, don't do anything + if (newDomain == domain) { return; } domain=newDomain; - try { - append( "deconnexion from domain "+ bus.getDomain(null)); - } catch ( IvyException ie ) { - System.err.println("deconnexion failed"); - } + append( "deconnexion from domain "+ bus.getDomain(null)); bus.stop(); try { bus.start(newDomain); @@ -221,8 +217,7 @@ class TestIvySwing extends JPanel implements IvyApplicationListener { System.out.println("closing"); bus.stop(); f.dispose(); - // I leave when the last TestIvySwing exits - if (--nbTIS == 0) System.exit(0); + if (--nbTIS == 0) System.exit(0); // I leave when the last TestIvySwing exits System.out.println("closed"); } public void windowActivated(WindowEvent e) {tfSend.grabFocus();} |