1 package SOFA.SOFAnode.Made.TIR.Access.TIRBrowser; 2 3 import java.awt.BorderLayout ; 4 import java.awt.event.WindowAdapter ; 5 import java.awt.event.WindowEvent ; 6 import java.rmi.Naming ; 7 8 import javax.swing.JFrame ; 9 import javax.swing.JLabel ; 10 11 import SOFA.SOFAnode.Made.TIR.Repository; 12 13 public class BrFrame extends JFrame { 14 public BrFrame() { 15 super("TIRBrowser"); 16 17 addWindowListener(new WindowAdapter () { 18 public void windowClosing(WindowEvent e) { 19 System.exit(0); 20 } 21 }); 22 23 String rmiport = System.getProperty("sofa.rmiport","1099"); 24 String rmihost = System.getProperty("sofa.rmihost","localhost"); 25 Repository rep; 26 27 try { 28 rep = (Repository) Naming.lookup("//"+rmihost+":"+rmiport+"/Repository"); 29 } catch (Exception e) { 30 getContentPane().add(new JLabel ("Connection to TIR cannot be created"), BorderLayout.CENTER); 31 return; 32 } 33 34 TIRBrowser browser = new TIRBrowser(rmihost,rmiport,rep); 35 getContentPane().add(browser, BorderLayout.CENTER); 36 } 37 } 38 | Popular Tags |