KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > coach > actor > componentBrowser > TclFrame


1 /***************************************************************************/
2 /* COACH: Component Based Open Source Architecture for */
3 /* Distributed Telecom Applications */
4 /* See: http://www.objectweb.org/ */
5 /* */
6 /* Copyright (C) 2003 Lucent Technologies Nederland BV */
7 /* Bell Labs Advanced Technologies - EMEA */
8 /* */
9 /* Initial developer(s): Harold Batteram */
10 /* */
11 /* This library is free software; you can redistribute it and/or */
12 /* modify it under the terms of the GNU Lesser General Public */
13 /* License as published by the Free Software Foundation; either */
14 /* version 2.1 of the License, or (at your option) any later version. */
15 /* */
16 /* This library is distributed in the hope that it will be useful, */
17 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
18 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
19 /* Lesser General Public License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public */
22 /* License along with this library; if not, write to the Free Software */
23 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
24 /***************************************************************************/
25 package org.coach.actor.componentBrowser;
26
27 import java.awt.*;
28 import javax.swing.*;
29
30 public class TclFrame extends JFrame {
31
32     public TclFrame() {
33     }
34     
35     public TclFrame(Component parent, String JavaDoc id, String JavaDoc facetName, org.omg.CORBA.Object JavaDoc target) {
36         this.getContentPane().add(new org.coach.tcl.TclShell(target, null), BorderLayout.CENTER);
37
38         setTitle(id + " " + facetName);
39         while(!(parent instanceof JFrame || parent instanceof Frame)) {
40             parent = parent.getParent();
41         }
42         Point pp = parent.getLocationOnScreen();
43         setLocation(pp.x + 10, pp.y + 10);;
44         setVisible(true);
45
46         setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
47         pack();
48     }
49 }
Popular Tags