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:

Verified
con.add(nb, BorderLayout.NORTH...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q6: import javax.swing.*; <br>import java.awt.*; <br>public class JDemoGridLayout
Q7: _ are lists of user options; they
Q8: The focusGained(FocusEvent) handler is defined in the
Q9: A BorderLayout is arranged in north, south,
Q10: A(n) _ is a tree of components
Q12: If you do not specify alignment, Component
Q13: The _ manager is the default manager
Q14: You use the _ interface when you
Q15: Describe the difference between an ActionEvent and
Q16: Layout managers are interface classes that align