Adding Components to a Frame
{"Image DocumentName": "Adding Components to a Frame", "Image ImageDescription": "A JFrame has several areas. Window decorations. (Optional) Menu bar. Content pane. Content pane is where components are added. Content pane is a Container object. Obtain reference to the content pane, and then add another component to it. JFrame frame = new JFrame( Example ); JButton button = new JButton( Click me! ); frame.getContentPane().add( button ); Content pane is where all the components live. When you\u2019re using a frame object you need to invoke the getContentPane method to get a reference to the object, and then add things to it.", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}