<div style='background-color: none transparent;'></div>
Home » » Medical Billing system

Medical Billing system

import java.sql.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
class Testee extends JFrame implements MouseListener
{
static String k[]=new String[20];
static String j[]=new String[20];

static JFrame jf=new JFrame("asasas");

static TextField b=new TextField(6);

static TextField to=new TextField(6);

static Choice ch=new Choice();

static TextField tf=new TextField(6);

static TextField tootal=new TextField(6);

static Button bt =new Button("Total");
static Button st =new Button("Sub Total");


static List lb1=new List();
static List lb2=new List();
static List lb3=new List();


public Testee()

{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection("jdbc:odbc:db1");
Statement s = c . createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY );
ResultSet rs = s.executeQuery("Select * from store");



int a=0;
while(rs.next())
{

j[a]=rs.getString(1);
k[a]=rs.getString(2);
a++;

}


jf.getContentPane().setLayout(new FlowLayout());

jf.getContentPane().add(ch);
jf.getContentPane().add(bt);
jf.getContentPane().add(b);
jf.getContentPane().add(tf);
jf.getContentPane().add(to);
jf.getContentPane().add(lb1);
jf.getContentPane().add(lb2);
jf.getContentPane().add(lb3);

jf.getContentPane().add(tootal);
jf.getContentPane().add(st);



ch.addMouseListener(this);
bt.addMouseListener(this);
st.addMouseListener(this);

for(int i=0;i{
ch.addItem(j[i]);
}



}


catch(Exception e){}
}
public void mouseClicked(MouseEvent e)
{

if(e.getSource()==ch)
{
//String s=ch.getSelectedItem();
int h=ch.getSelectedIndex();
tf.setText(k[h]);
}
if(e.getSource()==bt)
{ int x=Integer.parseInt(tf.getText());
int y=Integer.parseInt(b.getText());
int z=x*y;
String z1=Integer.toString(z);
to.setText(z1);
lb1.add(ch.getSelectedItem());
lb2.add(b.getText());
lb3.add(z1);
}

if(e.getSource()==st)
{
for (int w=0; w<=lb3.getItemCount(); w++)
{String c=lb3.getItem(w);
// int g=Integer.parseInt(c));
System.out.println(c);}
}



}

public void mouseExited(MouseEvent e){}

public void mousePressed(MouseEvent e){}

public void mouseEntered(MouseEvent e){}

public void mouseReleased(MouseEvent e){}

/*public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ch)
{String h=ch.getSelectedItem();
System.out.println(h);}

}

public void focusLost(FocusEvent e)
{
System.out.println("Looooost");
}*/



public static void main(String[] args)
{
Testee t=new Testee();
jf.setVisible(true);
}
}


Share this article :
 
Copyright © 2011. B.Sc B.Tech MCA Ploytechnic Mini,Main Projects | Free Main Projcets Download | MCA |B.tech . All Rights Reserved
Company Info | Contact Us | Privacy policy | Term of use | Widget | Advertise with Us | Site map
Template Modify by Creating Website. Inpire by Darkmatter Rockettheme Proudly powered by Blogger