aboutsummaryrefslogtreecommitdiff
path: root/examples/TestIvySwing.java
diff options
context:
space:
mode:
Diffstat (limited to 'examples/TestIvySwing.java')
-rw-r--r--examples/TestIvySwing.java17
1 files changed, 6 insertions, 11 deletions
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();}