From c3ef99ea8cf40c894b42fc1cb6f88c627b63e3e1 Mon Sep 17 00:00:00 2001 From: jestin Date: Fri, 7 Jun 2002 11:25:57 +0000 Subject: Minor corrections. --- examples/TestIvySwing.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'examples/TestIvySwing.java') 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();} -- cgit v1.1