KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > SOFAnode > Made > TIR > Access > TIRBrowser > BrFrame


1 package SOFA.SOFAnode.Made.TIR.Access.TIRBrowser;
2
3 import java.awt.BorderLayout JavaDoc;
4 import java.awt.event.WindowAdapter JavaDoc;
5 import java.awt.event.WindowEvent JavaDoc;
6 import java.rmi.Naming JavaDoc;
7
8 import javax.swing.JFrame JavaDoc;
9 import javax.swing.JLabel JavaDoc;
10
11 import SOFA.SOFAnode.Made.TIR.Repository;
12
13 public class BrFrame extends JFrame JavaDoc {
14   public BrFrame() {
15     super("TIRBrowser");
16
17     addWindowListener(new WindowAdapter JavaDoc() {
18       public void windowClosing(WindowEvent JavaDoc e) {
19         System.exit(0);
20       }
21     });
22
23     String JavaDoc rmiport = System.getProperty("sofa.rmiport","1099");
24     String JavaDoc rmihost = System.getProperty("sofa.rmihost","localhost");
25     Repository rep;
26     
27     try {
28       rep = (Repository) Naming.lookup("//"+rmihost+":"+rmiport+"/Repository");
29     } catch (Exception JavaDoc e) {
30       getContentPane().add(new JLabel JavaDoc("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