Skip to main content

Posts

Program of Making a simple calculator using java swing

import javax.swing.*; import java.awt.event.*; class Calc implements ActionListener {     JFrame f;     JTextField t;     JButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b0,bdiv,bmul,bsub,badd,bdec,beq,bdel,bclr;     static double a=0,b=0,result=0;     static int operator=0;     Calc()     {         f=new JFrame("Calculator");         t=new JTextField();         b1=new JButton("1");         b2=new JButton("2");         b3=new JButton("3");         b4=new JButton("4");         b5=new JButton("5");         b6=new JButton("6");         b7=new JButton("7");         b8=new JButton("8");         b9=new JButton("9");         b0=new JButton("0");         b...

HTML TABLE implementation

<html> <head> <title> exp3 </title> </head> <body> <table border=2 width=80% cellpadding=6 cellspacing=4 > <caption align =top> <h2><u>Department of computer science and engineering Info<BR>CSB(Time Table)</u></CAPTION> <TR><TD>DAY</TD> <TD>1</TD><TD>2</TD><TD>3</TD><TD>4</TD><TD>5</TD><TD>6</TD><TD>7</TD><TD>8</TD><TD>9</TD> <tr>  <th align=center> MON </TH> <td> Engineering Economics<br> <center>ms anjali dubey</center> <td cOlspan=2 BGCOLOR="GREEN"> 3F 03<BR>ESP<BR>PDP-B</td> <td> <CENTER>DBMS <BR>MS.ARCHANA SHARMA</CENTER> <td> <CENTER>DBMS <BR>MS.ARCHANA SHARMA</CENTER> <TD rowspan=5> <B>L<br><BR><BR><B...

java program which read data from file and show their details

package june29; import java.io.FileInputStream; import java.util.Scanner; public class input_from_file { public static void main(String[] args) throws Exception {  Scanner sc = new Scanner(System.in);  System.out.print("enter a file name with full path: ");  String filePath=sc.nextLine();  FileInputStream fis=new FileInputStream(filePath);  int bytes=fis.available();  int alphaUpper=0, alphaLower=0, numeric=0, space=0, line=1;  System.out.println("showing file data ->");  while(true)  {   int var=fis.read();     if(var==-1) {    break;   }   if(var>='A' && var<='Z') {    alphaUpper++;   }   else if(var>='a' && var<='z') {    alphaLower++;   }   else if(var>='0' && var<='9') {    numeric++; ...

java program which show application of string class

package june22; import java.util.Scanner; public class stringcheck_passwardusername { public static void main(String[] args) { System.out.println("Please enter your useername\t:\t"); Scanner sc = new Scanner ( System.in); String a=sc.nextLine(); System.out.println("enter your passward\t:\t"); String b=sc.nextLine(); if((a.equalsIgnoreCase( "ADMIN"))&&(b.equals("A@b123" ))){ System.out.println("welcome ADMIN"); } else System.out.println("invalid username or passward"); } }

JAVA program for finding the ip address of required host name

package june29; import java.net.InetAddress; public class testInetaddress { public static void main(String[] args) throws Exception { InetAddress in = InetAddress.getByName( "facebook.com"); String ip= in.getHostAddress(); String host=in.getHostName(); System.out.println(" host name: "+host); System.out.println("ip address : "+ip); } }

Bookmyshow program in java for booking the desire movie ticket

package june21; import java.util.Scanner; public class bookmyshow {  void input_details(){ System.out.println("\t\t#####  WELCOME TO THE BOOK YOUR SHOW   ####"); System.out.println(" .Please Enter the following Options"); System.out.println("   .Press 1 for  RAABTA Movie"); System.out.println("   .Press 2 for BAHUBALI 2 Movie"); System.out.println("   .Press 3 for  OK JAANU  Movie"); System.out.println("   .Press 4 for HALF GIRLFRIEND Movie"); String name,email,mobile,a;int n;float snaks;   Scanner sc = new Scanner (System.in); int choice = sc.nextInt(); while(true) { switch(choice) { case 1:  System.out.println(" \t\t\t\t*select your show timing*"); System.out.println("   .Press 1 for 12 to 3 show"); System.out.println("   .Press 2 for 3 to 6 show"); System.out.println("   .Press 3 for 6 to 9 show"); ...