Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4067694

adding a component to a frame with BorderLayout, component does not appear until

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.1.5
    • 1.1.3
    • client-libs
    • None
    • 1.1.5
    • x86
    • windows_95



      Name: rlT66838 Date: 07/28/97


      adding a component to a frame with BorderLayout, component does not appear until frame is resized

      Compile & execute the following code:

      import java.awt.*;
      import java.awt.event.*;

      public class myFrame extends Frame
      {
      public myFrame ()
      {
      super("ggg");
      }

      public static void main(String args[])
      {
      myFrame f = new myFrame();
      f.setBounds(10,10, 400, 300);
      f.setVisible(true);
      f.enableEvents(WindowEvent.WINDOW_CLOSING);
           f.setLayout(new BorderLayout());
           f.add(new TextArea()); // Same as p.add(new TextArea(), "Center");
        }

      protected void processEvent(AWTEvent e)
      {
      if (e.getID() == WindowEvent.WINDOW_CLOSING)
      System.exit(0);
      }
      }
      company - M.S.E , email - ###@###.###
      ======================================================================

            rkhansunw Robi Khan (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: