Examlex

Solved

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

question 1

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);
      -----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.


Definitions:

Blood Type

A classification of blood based on the presence or absence of inherited antigenic substances on the surface of red blood cells, significant for blood transfusions.

Erythrocytes Agglutinate

The clumping together of red blood cells, often as a reaction to certain antibodies or incompatibilities.

Transfused

The process of transferring blood or blood-based products from one person into the circulatory system of another.

Hemolytic Disease

A condition in which red blood cells are destroyed faster than they can be made, often due to an immune response.

Related Questions