import javax.swing.*; import java.awt.*; import
java.awt.event.*; import java.text.*; import
java.util.*;
public class Lab3fonts extends
JFrame { JButton b1,
b2; JLabel L1, L2; JTextField t1,
t2;
public Lab3fonts ()
{ super("fonts");
Container container = getContentPane();
container.setLayout(new FlowLayout());
setSize(400,200);
//Set Size of
Window
container.setBackground(Color.yellow);
L1 = new JLabel("this
is Ariel");
L1.setForeground(Color.black); L1.setFont(new
Font("Ariel",Font.BOLD,25));
t1 =
new JTextField("Century: ");
t1.setForeground(Color.black);
t1.setBackground(Color.pink); t1.setFont(new
Font("Century",Font.BOLD,15));
b1 =
new JButton("Times New Roman");
b1.setFocusPainted(false); b1.setFont(new Font("Times New
Roman",Font.ITALIC,20));
b1.setForeground(Color.black);
b1.setBackground(Color.yellow);
L2 =
new JLabel("Comic Sans MS");
L2.setForeground(Color.black); L2.setFont(new Font("Comic Sans
MS",Font.PLAIN,20));
t2 = new
JTextField("Cirsiva: ");
t2.setForeground(Color.black);
t2.setBackground(Color.pink); t2.setFont(new Font("Monotype
Corsiva",Font.BOLD,20));
b2 = new
JButton("Verdana");
b2.setFocusPainted(false);
b2.setForeground(Color.black);
b2.setBackground(Color.yellow); b2.setFont(new
Font("Verdana",Font.ITALIC,16));
container.add(L1);
container.add(b1);
container.add(t1);
container.add(L2);
container.add(b2);
container.add(t2);
setVisible(true); }
public
static void main(String args[])
{ Lab3fonts prog = new Lab3fonts
();
prog.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
} }
|