![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e559. Creating a FrameA frame is a top-level window with a title bar and buttons for iconizing, maximizing, and closing the frame.See also e733 Creating a JFrame. // Create frame String title = "Frame Title"; Frame frame = new Frame(title); // Create a component to add to the frame Component comp = new TextArea(); // Add the component to the frame; by default, the frame has a border layout frame.add(comp, BorderLayout.CENTER); // Show the frame int width = 300; int height = 300; frame.setSize(width, height); frame.setVisible(true); // See also e560 Setting the Icon for a Frame // See also e561 Making a Frame Non-Resizable
e561. Making a Frame Non-Resizable e562. Removing the Title Bar of a Frame e563. Setting the Bounds for a Maximized Frame e564. Iconifying and Maximizing a Frame e565. Hiding a Frame When Its Close Button Is Clicked e566. Exiting an Application When a Frame Is Closed e567. Getting All Created Frames in an Application e568. Determining When a Frame or Window Is Opened or Closed e569. Determining When a Frame or Window Is Iconized or Maximized
© 2002 Addison-Wesley. |