Examlex
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.
Q5: What is the toString() method used for
Q6: Label these Normative Judgments as Ethical (E),
Q10: Animals are moral patients if what we
Q23: The reason why it is wrong to
Q23: InputStream and OutputStream are subclasses of the
Q29: You can place as many statements as
Q35: Use the _ layout manager when you
Q37: int[][] myVals = new int[3][] <br>myVals[0] =
Q43: Create the statements to construct two JFrame
Q50: import java.nio.file.*; <br>import static java.nio.file.AccessMode.*; <br>import java.io.IOException;