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);
_____________________________________
_____________________________________
_____________________________________
}
public static void main(String[] args)
{
JFrameWithColor frame =
new JFrameWithColor();
frame.setVisible(true);
}
}
In the first shaded line provided, write the statement to set the background color of the JFrame's content pane to gray. Using the remaining two shaded lines, write the statements to set the JButton foreground color to white and the background color to blue.
Correct Answer:

Verified
con.setBackground(Color.YELLOW...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
Q8: import javax.swing.*;<br>import java.awt.*;<br>public class JDemoBorderLayout extends JFrame<br>{<br>private
Q9: The FlowLayout class contains _ constants you
Q13: Match each term with the correct statement
Q14: The Color class contains _ predefined color
Q15: Describe the difference between an ActionEvent and
Q15: Match each term with the correct statement
Q36: Write the statement to set the background
Q41: When you type "A", two _ key
Q45: The parent class for all event objects
Q46: A _ is placed at the top