Showing posts with the label Windows ProgramsShow all

13) The Card Layout demonstration program

source file name: CardLayoutDemo.java  import java.awt.*;   import java.awt.event.*;   public class CardLayoutDemo extends Frame implements ActionListener {   CardLayout card;   Button b1,b2,b3;   Panel p;   public  CardLayoutDemo() {                      p=new Panel();         card=new CardLayout(40,30);           p…

Read more

12) The screen designing by Border Layout Manager

source file name: BorderDemo.java  import java.awt.*; import java.awt.event.*; class BorderDemo extends Frame { String str="National Pledge"+ "\n India is my country and all Indians are my brothers and sisters."+ "\n I love my country and I am proud of its rich and varied heritage."+ &qu…

Read more

11) Students Biodata screen using Action Event

source code name: awtbiodata.java     import java.awt.*;       import java.awt.event.*;  class awtbiodata extends Frame implements ActionListener { Label l1,l2,l3,l4,l5,l6,l7; TextField t1,t2,t3; TextArea ta; List ls; Choice ch; Checkbox cb1,cb2;  public awtbiodata() {   GridLayout fl=new GridLayout(0,2,10,10); setLa…

Read more

10) Drawing three different Polygons on screen.

source code name: drawpolygons.java  import java.awt.*; class drawpolygons extends Frame { int x[]={100,60,60,100,150,150}; int y[]={100,150,200,250,200,150}; int x1[]={200,120,280}; int y1[]={270,350,350}; int x2[]={300,220,300,380}; int y2[]={100,150,220,150,}; public void paint(Graphics g) { g.drawPolygon(x,y,6); …

Read more

9) Display image on screen

source code name: showimage.java Image source file existence is mandatory    import java.awt.*; class showimage extends Frame { public static void main(String as[]) { System.out.println("windows programming"); showimage f=new showimage(); f.setTitle("Image Display Program"); f.setSize(300,500); f.…

Read more

7) Random color to rectangle using ActionEvent

source code : randomcolor.java     import java.awt.*;     import java.awt.event.*;  class randomcolor extends Frame {  Color col=Color.green;    public randomcolor(){  setLayout(null);      Button b1=new Button("randomcolor");//create button      b1.setBounds(100,80,100, 40);  add(b1);//adding button on fra…

Read more

6) Simple calculator window program using ActionEvent.

source code: calc.java import java.awt.*; import java.awt.event.*; class calc extends Frame implements ActionListener { TextField t1,t2, t3; public calc() { FlowLayout fl=new FlowLayout(); setLayout(fl); Label l1=new Label("enter a no:"); Label l2=new Label("enter b no"); Label l3=new Label("…

Read more

4) Login window program using ActionEvent

source code: login.java import java.awt.*; import java.awt.event.*; class login extends Frame implements ActionListener { TextField t1,t2; public login() { FlowLayout fl=new FlowLayout(); setLayout(fl); Label l1=new Label("user name"); Label l2=new Label("password");  t1=new TextField(15);  t2=new…

Read more