Project #77390 - Java program - layouts

Finish this so it looks like the attached jpeg.  Thanks.

/* Scott Costello

 * lay1fa.java

Layout #1 with flow part a

This applet will look like the example without any functionality, but

html file would have to have a smaller height to look exactly like it.

It will have a border layout applet with three panels - north and south

will have a grid to put both checkboxes or labels in it.  The center

will have a flow so the button can be left aligned.

Fill in the missing code at the comment spots.

*/

import java.awt.*;

import javax.swing.*;

 

public class lay1fb extends JApplet

{

 JCheckBox bike = new JCheckBox("I have a bike");

 JCheckBox car = new JCheckBox("I have a car");

 JButton submit = new JButton("Submit");

 JLabel lab1 = new JLabel("If you click the \"Submit\" button, the form-data will be sent to a");

 JLabel lab2 = new JLabel("page called \"html_form_action.asp\".");

 Container c;

 

 BorderLayout bord = new BorderLayout();

 GridLayout grid = new GridLayout(3, 2);

 JPanel center = new JPanel();

 // declare panels for north, center, and south

 

 

 

 

 

 // declare borderlayout for applet, gridlayout for north and south, flowlayout for center

 

 

 

 

 

 public void init()

 {

  c = getContentPane();

 

 // set container's layout to border, north and south's to grid, center's to flow

 

 

 

 

 

 

 // add checkboxes to north panel and north panel to north of applet

 

 

 

 

 

  flow.setAlignment(FlowLayout.LEFT); // aligns button on left of center panel

 

 // add button to center panel and center panel to center of applet

 

 

 

 

 // add labels to south panel and south panel to south of applet

 

 

 

 

 }

}

 

Subject Computer
Due By (Pacific Time) 07/27/2015 12:00 pm
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy