BCA Slip7 Java

Java

Slip7

Q.1) Write a java program to display “Hello Java” with settings Font- Georgia, Foreground color- Red, background color – Blue on the Frame (Use Label) [Marks 30] 

Solution

import java.awt.*;
public class Slip7 extends Frame
{
Label text;
public Slip7()
{
   text=new Label("Hello World!",Label.CENTER);
  Font f=new Font("GEORGIO",Font.BOLD,40);
  text.setFont(f);

add(text);
  //setBackground(Color.BLUE);
  setForeground(Color.RED);
  setSize(300,100);
  setVisible(true);
    }
     public static void main(String args[])
   {
   new Slip7();
   }
}

BCA Pratical Solution

My name is Vivek And I from Mumbai and Complete my Graduation Bca.my Age is 23 Years.

1 Comments

Previous Post Next Post