Home Tutorialhelp Comment java source code

 
 

Comment

Amit Kumar Verma
java source code,
October 4, 2010 at 7:56 PM

package DemoofHospital;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

//import com.mysql.jdbc.Connection;

//import com.mysql.jdbc.Connection;
//import com.mysql..ResultSet;

public class DoctorAlotement extends JFrame{
public void alotement(){
top();
setTitle("Doctor Alotment");
Toolkit tk=Toolkit.getDefaultToolkit();
Dimension dm=tk.getScreenSize();
setSize(dm);
Class c3=this.getClass();
URL url=c3.getResource("/images/amit7.jpg");
ImageIcon image=new ImageIcon(url);
JPanel jp=new JPanel();
add(jp);
jp.setLayout(new GridBagLayout());
GridBagConstraints gbc=new GridBagConstraints();
gbc.gridx=0;
gbc.gridy=0;
JLabel image1=new JLabel(image);
jp.add(image1,gbc);
gbc.gridx=0;
gbc.gridy=1;
JLabel jl=new JLabel("Patient Name");
jp.add(jl,gbc);
jl.setFont(new Font("SansSerif",Font.ITALIC,20));
jl.setBackground(Color.white);
jl.setForeground(Color.blue);
gbc.gridx=1;
gbc.gridy=1;
JTextField id=new JTextField(15);
jp.add(id,gbc);
id.setFont(new Font("SansSerif",Font.ITALIC,20));
id.setForeground(Color.BLACK);
gbc.gridx=0;
gbc.gridy=2;
JLabel jl1=new JLabel("gender");
jp.add(jl1,gbc);
jl1.setFont(new Font("SansSerif",Font.ITALIC,20));
jl1.setBackground(Color.white);
jl1.setForeground(Color.blue);
gbc.gridx=1;
gbc.gridy=2;
JTextField text=new JTextField(15);
jp.add(text,gbc);
text.setFont(new Font("SansSerif",Font.ITALIC,20));
text.setBackground(Color.white);
text.setForeground(Color.black);
gbc.gridx=0;
gbc.gridy=3;
JLabel combo1=new JLabel("Name of The Diceses");
combo1.setFont(new Font("SansSerif",Font.CENTER_BASELINE,20));
combo1.setBackground(Color.CYAN);
combo1.setForeground(Color.blue);
jp.add(combo1,gbc);
gbc.gridx=1;
gbc.gridy=3;
//String[] diceses={"Heart","Stumuck","Lungs","Physician","Medicine","Cancer","Skin","ChildSpeialist"};
// JComboBox combo=new JComboBox(diceses);
final JTextField combo=new JTextField(15);
combo.setFont(new Font("SansSerif",Font.CENTER_BASELINE,20));
combo.setBackground(Color.CYAN);
combo.setForeground(Color.red);
jp.add(combo,gbc);
gbc.gridx=1;
gbc.gridy=4;
JButton button=new JButton("Enter");
jp.add(button,gbc);
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost/hospital?user=root&password=amit");
PreparedStatement ps=con.prepareStatement("select *from doctor_list where Dicese=?");
String s1=combo.getText();
ps.setString(1,s1);
ResultSet rs=ps.executeQuery();
while(rs.next()){
String v1=rs.getString("Emp_id");
String v2=rs.getString("Doctor_Name");
String v3=rs.getString("Specialization");
String v4=rs.getString("Availibility_visitingDays");
String v5=rs.getString("Room_No");
String v6=rs.getString("Other_VisitingPlace");
String v7=rs.getString("Contact_NO");
String v8=rs.getString("Dicese");
System.out.println(v1);
System.out.println(v2);
System.out.println(v3);
System.out.println(v4);
System.out.println(v5);
System.out.println(v6);
System.out.println(v7);
System.out.println(v8);
}
}
catch(Exception p){p.printStackTrace();}

}

});
gbc.gridx=2;
gbc.gridy=4;
JButton button1=new JButton("Cancel");
jp.add(button1,gbc);
button1.addActionListener(new CancelListener());
setContentPane(jp);

}

public void top(){
setLayout(new BorderLayout());
JLabel jlabel=new JLabel("Doctor Alotement Window",JLabel.CENTER);
add(jlabel,BorderLayout.NORTH);
jlabel.setFont(new Font("SansSerif",Font.HANGING_BASELINE,40));
jlabel.setOpaque(true);
jlabel.setBackground(Color.WHITE);
jlabel.setForeground(Color.RED);
setVisible(true);
}

}


View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
General

Java call method from another class
Java call method from another class   ...; methods of another class. For this we have created two java files... of both the java files should match with each other. Here is the code 

JavaScript Questions

Calling java class method from javascript
Calling java class method from javascript  I want to call a java class method from javascript. The java class method is like "public String[] getWord()". I want to assign this string array value to a variable in javascript. I 

Java Beginners

How to call the run method from another class?
How to call the run method from another class?  Sorry, if this is a stupid question. I would like to find out how to call the run method... AdaugaChitanta.java. If I don't call a method, then I have to run FereastraPrincipala.java again 

General

JavaScript array push() method
JavaScript array push() method       In this example code of JavaScript array push() method we...; Here is the full example code of JavaScript array push() method example 

General

JavaScript Array
.   Java call method from another class...() method In this example code of JavaScript array push() method we have... reverse example JavaScript Array class have one method reverse 

General

JavaScript array object reference
JavaScript array object reference   ... that helps you in understanding JavaScript array object reference. For this we are using Java Scripting language. We declare an array variable that is used 

General

JavaScript Array Contains Method
it.. JavaScript code to use contain method in an array <html> <head>... JavaScript Array Contains Method       In the given JavaScript array example, we are going 

Java Beginners

javascript call action class method instruts
javascript call action class method instruts  in struts2 onchange event call a method in Actionclass with selected value as parameter how can i do 

Java Beginners

Source Code - Java Beginners
Source Code  How to clear screen on command line coding like cls in DOS?  Hi Friend, Here is the code to execute cls command of DOS through the java file but only one restriction is that it will execute 

Mobile Applications Questions

UIWebView call javascript function
UIWebView call javascript function  Hi, I am developing web browser for iPhone and iPhone devices. I want to call the java script in my html page from UIWebView. Please let's know how to call JavaScript function from objective c 

General

Use of Local Inner class
;  The Java language enables you to define a class inside another... Inner class. The code include a Outer class Inner class include a method that add.... The inner class Get Even Integer is same as Java iterators,The work of Get Even 

Java Beginners

source code - Java Beginners
source code  Hi...i`m new in java..please help me to write program that stores the following numbers in an array named price: 9.92, 6.32, 12,63... user-input numbers into units array when program run. use input dialog box 

Programming Tutorials

Use of array() method of FloatBuffer class in java.
Use of array() method of FloatBuffer class in java.  In this tutorial, we...[] array() The array() method returns float array based on float... buffer array : 255 Download this code 

Programming Tutorials

JavaScript array join
to understand JavaScript array join. For this we are using Java Script language... JavaScript array join     ...;   JavaScript_Array_join.html <html>   < 

Java Beginners

function call in javascript - Java Beginners
function call in javascript  hi all, i've written a javascript , but i m unable to call a function getExpression.i dont know why getExpression function is not being called. heres my code : function 

General

JavaScript array valueOf
JavaScript array valueOf       JavaScript array class have valueOf() method which returns...; <head> <title> JavaScript array valueOf() method example < 

General

JavaScript array sort alphabetically
JavaScript array sort alphabetically       We can sort the JavaScript array elements by using the sort() method of Array class in JavaScript. Syntax of the sort method 

General

JavaScript array reverse example
JavaScript array reverse example       JavaScript Array class have one method reverse() which... by using the method reverse(). Here is the full example code of JavaScript array 

General

How to Invoke method using Reflection API of Java?
of this string. We will show you how to call the concat method of the String class dynamically. Following is the steps to call the concat method of String class... object for the class whose method is to be invoked. Here we have used the code 

Java Beginners

Call an array from multiple functions
Call an array from multiple functions  I am having two methods in this method i am getting array values from another class. i create same array name for accessing the method values(array) but it will access only one method values 

General

JavaScript array splice
;  One more useful method of JavaScript Array class is splice() method... is the full example code of JavaScript array splice() example as follows:    ...;    JavaScript array splice() method example </title> 

Java Tips and Examples

Copying an array to another
Copying an array to another       Java Copy Array Example:In this tutorial, you will learn how to copy data from one array to another. Here, providing you an example with code 

Java Beginners

get the value from another class - Java Beginners
get the value from another class  Hello to all, I have stupid question. I have main.java and ConfigXML.java(read my config xml file). Code from ConfigXML.java [code] NodeList flnamelist = flcon.getElementsByTagName 

General

JavaScript Array Class
JavaScript Array Class       In this section, you will study how to use Array class in JavaScript.  The Array class is one of the predefined classes available in JavaScript 

General

JavaScript array join
to understand JavaScript array join. For this we are using Java Script language... JavaScript array join     ...;   JavaScript_Array_join.html <html>   < 

Java Beginners

java call by reference - Java Beginners
java call by reference  in java do we have ane term like call... you call a method by reference, the callee sees the caller?s original variables... affect the caller?s original variables. Java never uses call by reference. Java 

Java Beginners

call frame - Java Beginners
call frame   dear java, I want to ask something about call frame to another frame and back to first frame. I have FrameA and FrameB. In frameA...(browse) then view FrameB. In FrameB i fill JTextfield1(FrameB) with "JAVA 

Java Beginners

array in javascript - Java Beginners
array in javascript  how to initialize array in javascript and can we increase the size of array later on? is Array class in javascript ? also...://www.roseindia.net/java/javascript-array/index.shtml Hope 

Programming Tutorials

JavaScript Copy Array
another array object 'arr2' and by using the method slice(), the elements of arr1 is copied to the arr2.  Code for copying the value of one array into another... JavaScript Copy Array      

Java Beginners

source code
source code  how to use nested for to print char in java language?   Hello Friend, Try the following code: class UseNestedLoops{ public static void main(String[] args){ char[][] letters = { {'A', 'B'}, {'C','D 

General

JavaScript array method
JavaScript array method     ... in understanding JavaScript Method For this method we have JavaScript as script... element by calling array. length( ) method.         

General

JavaScript toObject() method
JavaScript toObject() method       Use of toObject() method of Hash class in JavaScript. Hash is just like an associative array, binding unique keys to values. This method 

General

JavaScript Array of checkboxes
JavaScript Array of checkboxes   ... that help you in understanding JavaScript Array of checkboxes. For this we...; Output of the program Download source code 

Java Beginners

java source code - Java Beginners
java source code  write a program to read the value of n as total number of friend relatives to whom the person wants to call 

General

JavaScript array slice
JavaScript array slice       JavaScript array class's slice() method returns the selected items... of the array. Syntax of the slice() method is as follows: arrayObject.slice 

General

JavaScript array merge
JavaScript array merge     ... in understanding how to merge two different array into one array using Java Script. We... print the list of element in an array. In the same way we declare another array 

Core Java

Inner class in java
:- This class is defined within a block of Java code so like a local variable...(); a.max(); } } Output of Inner Class Download Source Code...Inner class in java In this example we will describe inner classes in java 

JSP Servlet Questions

how to call a java class in jsp - JSP-Servlet
how to call a java class in jsp  hi.. friends iam new to roseindia.i found it very nice site to clarify our douts. i have a problem to use my java class in a jsp.can anyone please help me with this query 

JSP Servlet Questions

how to call a java class in jsp - JSP-Servlet
how to call a java class in jsp  hi.. friends iam new to roseindia.i found it very nice site to clarify our douts. i have a problem to use my java class in a jsp.can anyone please help me with this query 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends class A { static method() } class C { } //how to access static method() from B to C 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends class A { static method() } class C { } //how to access static method() from B to C 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends class A { static method() } class C { } //how to access static method() from B to C 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends A { static method() } class C { } //how to access static method() from B to C 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends A { static method() } class C { } //how to access static method() from B to C 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends A { static method() } class C { } //how to access static method() from B to C 

Java Beginners

java source code - Java Beginners
java source code  I have written a source code for recording invoices. I wish it to be evaluated. Could somebody help me with it? Moreover, I do not know the method to attach the JAR for evaluation. My email 

General

Insert an array list of objects with addAll(ArrayList) method
Insert an array list of objects with addAll(ArrayList) method In this section you will learn to insert an array list of objects to another list...) method in more detail.   Create a class "addAll" 

General

How to Print Array in JavaScript
on the button , it will display the content of an array. Download Source Code...How to Print Array in JavaScript In this section you will learn about Array in JavaScript. Array are important part of all programming languages. Array 

JavaScript Questions

Dynamically added Row is Invisible in another javascript function..?
Dynamically added Row is Invisible in another javascript function..?  ... with below code)..but when add row its creating row in a table, but the created row is not visibile in another java script function. scripts are pasted at the bottom 

General

JavaScript array of functions
in understanding a JavaScript array of functions. For this we are using Java Script... JavaScript array of functions   ...( ).            Javascript_Array_of_functions.html 

Java Beginners

call frame again - Java Beginners
the form. * WARNING: Do NOT modify this code. The content of this method...call frame again  d, thank's for your answer, but i can't combine to my script. I will give you a complete code and please check this. the program 

Java Technology Tutorials

Class
and Perimeter of the square and another class is rectangle which is using for getting.... Constructor is the method which name is same to the class. But there are many difference... is using two classes. First class is another and second is the main class which 

Java Beginners

java array
java array  write a java method that takes an array of float values... are distinct)   Hi Friend, Try the following code: import java.util.*; class...)){ System.out.println("There are duplicate elements."); Float array 

Development process Questions

call by reference - Development process
call by reference  Hello , Is thre callbyvalue in java..., callByvalue When you call a method, the method sees a copy of any primitives passed.... This is code of callByvalue public class CallByValue { public static void 

Java Beginners

source code in java for a program using class - Java Beginners
source code in java for a program using class  Dear sir/madam i want source code in java for following program: WAP which creates a class accountthat stores customer name,account number and type of account.From this derive 

JDBC Questions

Javascript - JDBC
and javascript I want to write the event handling code in another jsp page .so... of the select box, call a method in Javascript, lets say validateSelect(), by sending... give me a hint or source code? Thanks and Regards Gauri. Bangalore.   

Java Beginners

array problem java - Java Beginners
]; int num; Write Java statements that do the following: a. Call the method..., respectively. d. Call the method funcTwo with the actual parameters,list and Alist, respectively. another problem.,, 2.)Suppose list is an array of five 

JavaScript Tutorial

JavaScript setUTCDate method
JavaScript setUTCDate method       JavaScript setUTCDate() method when applied to a date object it sets... of the date object's month. In this part of JavaScript method tutorial we 

General

JavaScript Array Apply
JavaScript Array Apply     ... the apply method to call the Car constructor. In the Car function, the keyword...]) The apply method call a function and specify what the keyword 'this' will refer 

Java Beginners

java source code - Java Beginners
java source code  hello Sir, Im a beginner in java.im greatly confused, so plz send me the source code for the following concept: Telephone... code: import java.io.*; import java.util.*; class Directory implements 

JavaScript Tutorial

JavaScript setDate method
JavaScript setDate method       JavaScript setDate() method can be used to set a date value to the date... is required to call setDate() method. "dateValue" will hold any 

General

JavaScript Array Clone
. Here is the code for creating clone of array in JavaScript.. <html>... JavaScript Array Clone       As you know, the property 'prototype' of Array class can add 

General

Java clone method example
. The clone ( ) is  a constructor that call the clone method of super class... Java clone method example       Java clone method is used to present the duplication of object 

Java Beginners

Java class method - Java Beginners
Java class method  I have created a method that's supposed to return a basetime value, returning a string value, the problem is that i need to have it return a basetime to use it later. How can i modify this code to have 

JavaMail Questions

call from java - JavaMail
the java.net package to call a servlet from the java code...call from java  Hi, how i will call servlet from java.. plz its...*; public class ServletExample extends HttpServlet { protected void service 

Java Beginners

How to call java method on Button click in jsp?
How to call java method on Button click in jsp?  How to call java method on Button click in jsp 

Java Beginners

source code program - Java Beginners
source code program  I need the source code for a program... kilometers to miles and vice versa using Java "classes".  Hi ! class temp { public static void main(String cp[]) { int x=0,y 

Java Beginners

calendra.css source code - Java Beginners
calendra.css source code  hello i need the source code.../javascript/javascript-calendar.shtml Becoz due to missing of file by defaul month day and year are getting displayed  Hi Friend, Try the following code 

Programming Tutorials

Use of hasArray() method of ByteBuffer class in java.
Use of hasArray() method of byte buffer class in java. In this tutorial, we...() The hasArray() method check associated buffer is based on byte array... on array Download this code 

General

JavaScript Array Count
to count the length of array. For that we have to use the count() method in our code... is the JavaScript code for getting the length of an array. <html>... is the length of array. Download Source Code 

JSP Interview Questions

Javascript array methods
Javascript array methods  Write a Javascript code,for array element insertion from front. array element insertion from back. array element deletion... this: <script type="text/javascript"> var lang = new Array(); lang[0] = "C 

Java Interview Questions

Java source code
Java source code  How are Java source code files named 

Struts Questions

shoping items billng source code
)price.jsp: <%@page language="java" import ="java.sql.*" %> <% String code...shoping items billng source code  Hi, I am doing a project on invoice making, I am unable to make code for the billing, I have a n jsp page "invc.jsp 

Struts Questions

shoping items billng source code
)price.jsp: <%@page language="java" import ="java.sql.*" %> <% String code...shoping items billng source code  Hi, I am doing a project on invoice making, I am unable to make code for the billing, I have a n jsp page "invc.jsp 

Struts Questions

shoping items billng source code
)price.jsp: <%@page language="java" import ="java.sql.*" %> <% String code...shoping items billng source code  Hi, I am doing a project on invoice making, I am unable to make code for the billing, I have a n jsp page "invc.jsp 

Struts Questions

shoping items billng source code
)price.jsp: <%@page language="java" import ="java.sql.*" %> <% String code...shoping items billng source code  Hi, I am doing a project on invoice making, I am unable to make code for the billing, I have a n jsp page "invc.jsp 

Struts Questions

shoping items billng source code
)price.jsp: <%@page language="java" import ="java.sql.*" %> <% String code...shoping items billng source code  Hi, I am doing a project on invoice making, I am unable to make code for the billing, I have a n jsp page "invc.jsp 

Java Beginners

Javascript code - Java Beginners
Javascript code  Hi, This is ragavendran.. I have a simple doubt in my project.. There is a page in which there is a table with each row ending... row should be color changed.. In the second phase, if i click another link 

General

JavaScript array union
JavaScript array union   ... union in Java Script. The code contain a script that include a variable arr1...; This method remove the duplicate element from combined array object elements 

Java-Tutorials

Class Cast Exception Example in java
Class Cast Exception Example in java We are going to describe class cast exception in java. The class cast exception is a converting one data type into another data type. A Class cast exception is a thrown by java. In this example 

Swing AWT

how to open one Jframe from main method call
the main() method, when i run this Engine.java class game starts running... don't want in my project Here is the code that i have included in main method...how to open one Jframe from main method call  I have downloaded 

Java Beginners

call another computer in LAN (no internet acces)
call another computer in LAN (no internet acces)  Any idea how to develop a java application that makes VOIP calls inside an isolated (without internet access) network? Is there any (free) software solution for my problem? Thank 

General

JavaScript Array Clear
JavaScript Array Clear       Clear() method is used to clear all the defined array. In this section, you will study how to clear the Array in JavaScript. You can see 

General

JavaScript array methods
in understanding 'JavaScript array method'. For this we are using JavaScript ... JavaScript array methods     .../javascript">   var array=new Array();   array[0 

General

JavaScript array prototype
JavaScript array prototype     ... by using the property "prototype" of the array class. In the web...;   javascript_array_prototype.html <html> <head> < 

General

Java Nested Class
Java Nested Class         In Java programming language, when a class is defined within another...;    Java main Method   Every Java program 

Programming Tutorials

JavaScript Array Clear
JavaScript Array Clear In this tutorial you will learn how to use the clear method in your JavaScript program. Clear() method is used to clear all... in JavaScript. You can see in the given example, we have create an instance of array which 

Struts Questions

java source code
java source code  java source code to create mail server using struts2 

Programming Tutorials

Java Merge Array
of any size and store them into another array. Here is the code: import...Java Merge Array You all are aware of Arrays, their structure, declaration... with an example. In the given code, we have created a method 'merge()' where we have 

Programming Tutorials

JavaScript array join
in understanding JavaScript array insert. For doing this code we are using JavaScript... JavaScript array join     ...( )   -  This method return you to add  element to an array 

Java Beginners

class - Java Beginners
class  i want below programs with concepts(includes source code) Abstract class Shapes has one abstract method-area() and a concrete method... implement the Perimeter interface Class Rectangle extends another class 

Java Beginners

class - Java Beginners
class  i want below programs with concepts(includes source code) Abstract class Shapes has one abstract method-area() and a concrete method... implement the Perimeter interface Class Rectangle extends another class 

General

JavaScript array remove by index
then we can use the JavaScript array's splice() method. For removal... code of array remove by index in JavaScript is as follows: javascript_array... JavaScript array remove by index    

General

JavaScript array pop
() method adds one or more elements into the JavaScript array similarly the JavaScript's array object pop() method removes an element from the bottom of the array... of JavaScript array pop method we have created an array of the length 5 and then added five 

Programming Tutorials

Use of isDirect() method of intBuffer class in java.
Use of isDirect() method of intBuffer class in java. In this tutorial, we...; the associated int arrayCode import java.nio..... The java.nio.IntBuffer class extends java.nio.Buffer class. It provides the following methods 

Apache Velocity

Call class methods
Call class methods       This Example shows you how to call class method in velocity...: Use put() method of Class VelocityContext through object 'ctx'. 4: Create 

HTML Questions

mini project using html,javascript and ms access with source code
mini project using html,javascript and ms access with source code  I want a mini project which uses html and java script and backend as ms access with source code. plz send its important and urgent 

Java-Tutorials

How to write content of one file to another file.
off, int len) The write(..) method writes an array of bytes onto... Download Source Code... the use of CheckedOutputStream class. The CheckedOutputStream class is from 

Programming Tutorials

Use of equals() method of  FloatBuffer class in java.
Use of equals() method of  FloatBuffer class in java.  ... class. It provides the following methods: Return type Method... or not to another object. If another buffer is not float buffer method returns 

Programming Tutorials

Use of equals() method of LongBuffer class in java.
Use of equals() method of LongBuffer class in java.  In this tutorial, we... obj) The equals() method tells this buffer is equals or not to another object. If another buffer is not long buffer method returns false 

Advertisements Advertisements
 

 

 

DMCA.com