Solved

Import Javax.swing.*; Import Java.awt.*;

Question 63

Essay

import javax.swing.*;
import java.awt.*;
public class JDemoBorderLayout extends JFrame
{
    private JButton nb = new JButton("North Button");
    private JButton sb = new JButton("South Button");
    private JButton eb = new JButton("East Button");
    private JButton wb = new JButton("West Button");
    private JButton cb = new JButton("Center Button");
    private Container con = getContentPane();
    public JDemoBorderLayout()
    {
       con.setLayout(new BorderLayout());
       -----Code here-----
       -----Code here-----
       -----Code here-----
       -----Code here-----
       -----Code here-----
       setSize(400, 150);
     }
     public static void main(String[] args)
     {
        JDemoBorderLayout frame = new JDemoBorderLayout();
        frame.setVisible(true);
     }
}
Using the above code, write the statements in the indicated lines to add components to each of the five regions (north, south, east, west and center).

Correct Answer:

verifed

Verified

con.add(nb, BorderLayout.NORTH...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents