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
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q44: What is a mnemonic? Provide an example
Q46: Write the statement to set the background
Q51: Write the code to create a scroll
Q60: List and describe the four constructors that
Q60: Match each term with the correct statement
Q61: Write the statement to establish a GridLayout
Q62: import javax.swing.*;
import java.awt.*;
public class JDemoGridLayout extends JFrame
{
private
Q64: Using a FlowLayout object named myLayout ,
Q65: import java.awt.*;
import javax.swing.*;
import java.awt.Color;
public class Checkerboard extends
Q66: import javax.swing.*;
import java.awt.*;
public class JDemoBorderLayout extends JFrame
{
private
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents