Examlex
import javax.swing.*;
import java.awt.*;
public class JDemoGridLayout extends JFrame
{
private JButton b1 = new JButton("Button 1");
private JButton b2 = new JButton("Button 2");
private JButton b3 = new JButton("Button 3");
private JButton b4 = new JButton("Button 4");
private JButton b5 = new JButton("Button 5");
-----Code here-----
private Container con = getContentPane();
public JDemoGridLayout()
{
con.setLayout(layout);
con.add(b1);
con.add(b2);
con.add(b3);
con.add(b4);
con.add(b5);
setSize(200, 200);
}
public static void main(String[] args)
{
JDemoGridLayout frame = new JDemoGridLayout();
frame.setVisible(true);
}
}
Using the above code, write the statement in the indicated line to establish a GridLayout with three horizontal rows and two vertical columns, with horizontal and vertical gaps of five pixels each.
Q3: Ethical considerations always start with the top,
Q12: What is the process of inlining and
Q12: What are some of the advantages of
Q13: Natural Law is the same as<br>A) Law
Q13: According to Aristotle the good is<br>A) The
Q26: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TBX9005/.jpg" alt=" The shaded
Q28: Give an example of how you can
Q30: Affirmative action programs presume that past discrimination
Q40: What is a finally block and how
Q51: What is the difference between derived classes