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:

Credit Sales

Sales transactions where the payment is deferred to a future date, allowing customers to purchase goods or services on credit.

Accounts Receivable

Money owed to a business by its customers for goods or services delivered but not yet paid for.

Cash Budget

A budget that estimates cash inflows and outflows over a specific period of time, aiding in managing the company's cash balance.

Loan Balance

The remaining amount owed on a loan, not including future interest, at any given time.

Related Questions