Essay
import java.awt.*;
import javax.swing.*;
import java.awt.Color;
public class JFrameWithColor extends JFrame
{
private final int SIZE = 180;
private Container con = getContentPane();
private JButton button =
new JButton("Press Me");
public JFrameWithColor()
{
super("Frame");
setSize(SIZE, SIZE);
con.setLayout(new FlowLayout());
con.add(button);
-----Code here-----
-----Code here-----
-----Code here-----
}
public static void main(String[] args)
{
JFrameWithColor frame =
new JFrameWithColor();
frame.setVisible(true);
}
} In the first indicated line, write the statement to set the background color of the JFrame 's content pane to gray. Using the remaining two indicated lines, write the statements to set the JButton foreground color to white and the background color to blue.
Correct Answer:

Verified
Correct Answer:
Verified
Q2: The wildcard in the import java.awt.* statement
Q3: What is the parent class of JPanel
Q4: When do you need to worry about
Q5: Which of the following statements will correctly
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
Q11: import javax.swing.*; <br>import java.awt.*; <br>public class JDemoBorderLayout