Develop a program to print India Flag 15Aug2019 +++ Happy Independence day in Java Swing Advanced Java

import javax.swing.*;
import java.awt.*;
class Flag extends JFrame
{
Flag()
{
JTextField t1=new JTextField();
t1.setBounds(50,40,130,30);
t1.setBackground(Color.ORANGE);
add(t1);
JTextField t2=new JTextField();
t2.setBounds(50,70,55,30);
add(t2);
JRadioButton r1=new JRadioButton();
r1.setBounds(105,70,20,30);
r1.setBackground(Color.BLUE);
add(r1);
JTextField t4=new JTextField();
t4.setBounds(125,70,55,30);
add(t4);

JTextField t3=new JTextField();
t3.setBounds(50,100,130,30);
t3.setBackground(Color.GREEN);
add(t3);
setSize(300,310);
setLayout(null);
setVisible(true);
}
public static void main(String ar[])
{
new Flag();
}
}

Output:

Comments