Examlex

Solved

Import Java.awt.*; Import Javax.swing.*;

question 11

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.


Definitions:

Font Color

The color of the text characters in a document or application, which can be customized for visual impact or legibility.

Form Layout View

A viewing mode or interface in database or form applications that allows users to see the form as it will appear in use, facilitating data entry or editing.

Align Center

A formatting option that positions text or objects in the middle of a page or container horizontally.

Report Wizard

A tool that guides users through the process of creating complex reports by answering a series of questions.

Related Questions