OSDN Git Service

7de86faf5adb33c2f6077a681cda51c722871c54
[pf3gnuchains/gcc-fork.git] / libjava / java / awt / Frame.java
1 /* Copyright (C) 1999  Red Hat, Inc.
2
3    This file is part of libjava.
4
5 This software is copyrighted work licensed under the terms of the
6 Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
7 details.  */
8
9 package java.awt;
10 import java.awt.peer.FramePeer;
11
12 /* A very incomplete placeholder. */
13
14 public class Frame extends Window implements MenuContainer
15 {
16   MenuBar menuBar = null;
17   String title;
18
19   public Frame ()
20   { /* FIXME */ }
21
22   public Frame (String title)
23   {
24     this();
25     setTitle(title);
26   }
27
28   public String getTitle () { return title; }
29
30   public void setTitle (String title)
31   {
32     this.title = title;
33     if (peer != null)
34       ((FramePeer)peer).setTitle(title);
35   }
36
37   public synchronized void dispose ()
38   { /* FIXME */ }
39
40   public synchronized void setMenuBar (MenuBar menuBar)
41   { this.menuBar = menuBar; }
42
43   public synchronized void addNotify ()
44   {
45     if (peer == null)
46       {
47         FramePeer fpeer = Toolkit.getDefaultToolkit().createFrame(this);
48         // Compiler bug requires cast ??;  FIXME?
49         peer = (java.awt.peer.ComponentPeer) fpeer;
50         if (width + height > 0)
51           peer.setBounds(x, y, width, height);
52       }
53     super.addNotify();
54   }
55 }