Home Java Java Example Codes and Tutorials
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Java Example Codes and Tutorials

Advertisement
Java is great programming language for the development of enterprise grade applications. This programming Language is evolved from a language named Oak.

Java Tutorials - Java Example Codes and Tutorials

Java is great programming language for the development of enterprise grade applications. This programming Language is evolved from a language named Oak. Oak was developed in the early nineties at Sun Microsystems as a platform-independent language aimed at allowing entertainment appliances such as video game consoles and VCRs to communicate . Oak was first slated to appear in television set-top boxes designed to provide video-on-demand services. Oak was unsuccessful so in 1995 Sun changed the name to Java and modified the language to take advantage of the burgeoning World Wide Web.

Java is an object-oriented language, and this is very similar to C++. Java Programming Language is simplified to eliminate language features that cause common programming errors. Java source code files are compiled into a format called bytecode, which can then be executed by a Java interpreter.

If you are beginner read How to Get Started with Java? and New to programming section.

Section I - Introduction to Java

This section introduces you the Java programming language. These days Java programming language is being used for programming web  applications. It is also widely used for mobile and electronic items.

  1. What is Java?
    Java is a high-level object-oriented programming language developed by the Sun Microsystems. Though it is associated with the World Wide Web but it is older than the origin of Web.
      
  2. Java as an Internet Language
    Java is an object oriented language and a very simple language. Because it has no space for complexities. At the initial stages of its development it was called as OAK. OAK was designed for handling set up boxes and devices.
      
  3. Java as general purpose language
    Java is an Object oriented application programming language developed by Sun Microsystems.
      
Advertisement

Java programming tutorials:

Java Flavors
 
Java For Beginner   Master-Java
  1. New to Java?
    If you are new to Java technology and you want to learn Java and make career in the Java technology then this page is for you.
      
  2. Use of Java
    Java technology is a high-level programming and a platform independent language. Java is designed to work in the distributed environment on the Internet.
     
  3. Java Exception
    In this Java exception handling tutorial, you will learn about different types of exception and errors with the solutions to handle it. Basically exceptions in Java are used to handle errors and exceptional events. Go through the given tutorial to find out more on exceptions..
     
  4. Java Get Example
    An introduction to various methods and functions to get the different values in Java. After going through this section, you will be able to get the date, time, certain values and directory path etc..
     
  5. Pass Value Example
      
  6. Java Break Example
     
  7. Java Biginteger
     
  8. Java Bigdecimal
      
  9. JavaScript Array
     
  10. Java Methods
     
  11. Java Write
      
  12. Java Programming Introduction
    Java programming language is useful for development of enterprise grade applications. Java language comes in light from a language named Oak.
     
  13. Learn Java In A Day
    Java is the most exciting object oriented programming language in computer programming landscape
     
  14. Learn Java Quickly
    This is one page introduction to java, that will teach you the basics of java. In this quick Java tutorial you will download, install and then create very first java program.
     
  15. Java Tools
    Java Development Kit or JDK comes with lots of tools for compiling and running the programs. These tools also contains programs to test and document the programs. In this Java Tools tutorials we will provide you detailed introduction of these Java Tools.
     
  16. Beginners Java Tutorials
    Java Tutorial for beginners.
     
  17. Java Conversion Tutorials
    Java conversion tutorials with example.
     
  18. Java Comparison
      
  19. Java String Examples
    Java String tutorials with example.
     
  20. Java Exceptions
    Exceptions are nothing but some anomalous conditions that occur during the execution of the program. Exceptions are the conditions or typically an event which may interrupt the normal flow of the program's instructions. 
     
  21. Wrapper Class Tutorials and Examples
    Wrapper class is a wrapper around a primitive data type. It represents primitive data types in their corresponding class instances e.g. a boolean data type can be represented as a Boolean class instance. 
      
  22. Reflection API Tutorials and Examples
    Reflection API is a powerful technique (that provides the facility) to find-out Its environment as well as to inspect the class itself. Reflection API was included in Java 1.1. 
      
  23. Java Applet Tutorials
    Introduction to Java Applet and example explaining how to write your first Applet. Java Applet tutorials for beginners, collection many Java Applets example with running code. 
      
  24. Java iText - Open Source PDF Libraries
    iText is a java library that provides the facilities for generating PDFs. You can improve the look and feel of your html which is the browser independent by using this java library. You can get more about the iText library inside the topic.
      
  25. Java Ftp Libraries
    Here you will get some tutorials related to the java ftp including ftp libraries and some important explained examples.
      
  26. Various Commands that are used in java are given below
    A Java Compiler javac is a computer program or set of programs which translate java source code into java byte code.
      
  27. Java ClassPath
    Java is an OOP language. In java programming language for compiling the program we use the compiler that converts the source code into the byte code after that, that byte code is interpreted by JVM that converts the bytecode into the machine independent code.
     
  28. Task Scheduling in JAVA
    In some applications some task need to run periodically, for example a application of report generating checks for new database entry after one day and make reports according to the entries then save all entries in company's permanent record.
     
 
  1. Master Java Tutorials (TOC)
    This tutorial will make you perfect in Java i.e. the master of Java. You can be master of Java by going through the Master Java Tutorial.
     
  2. Java as a programming language
    Java is an Object oriented application programming language developed by Sun Microsystems. Java is a very powerful general-purpose programming language.
     
  3. Java as an Object Oriented Language
    In this section, we will discuss the OOPs concepts along with  fundamentals  used to develop the java applications and programs.


  1. JEE 5 Tutorial
    Welcome to JEE 5 tutorial guide, here you will find everything need to know about Java Enterprise Edition 5 for developing best enterprise application based on JEE technologies.
     
  2. JDK 6 Tutorial
    The latest news for the java programmers that the Sun MicroSystems has released the Java SE 6 on Monday December 11. So go and grab your copy.  It has been released with the promises to ease the complexities faced in the jdk 1.5. 
     
  3. Java IO Package Examples
    The Java I/O is the collection of java classes and interfaces for reading and writing on to stream, byte stream and array of byte stream.
     
  4. Java AWT Package Examples
    In this section you will learn about the AWT package of the Java. Many running examples are provided that will help you master AWT package.
     
  5. Java UDP Tutorial
    UDP Tutorial with many examples in Java.
     
  6. Swing Example
    Here you will find many Java Swing examples with running source code. Source code provide here are fully tested and you can use it in your program.
     
  7. Java util Examples
    The util package or java provides many utility interfaces and classes for easy manipulation of in-memory data. The java util package tutorials  at RoseIndia.net introduces you with the Java util package of JDK.
     
  8. Java Threading Tutorial
    Threading concept is very important in Java Programming language. A thread is a sequential path of code execution within a program. And each thread has its own local variables, program counter and lifetime.
     
  9. Java 5 Tutorials
    Java 5.0 tutorials.
     
  10. Java-Network Tutorials
    The Java platform is extremely preferable to write an application program require to communicate with the resources on network.
     
  11. Simple java program
    Write a simple java program to makes a profit a local store marks up the prices of its items by 25%.
     
  12. Java Virtual Machine
    JVM is the main component of Java architecture and it is the part of the JRE (Java Runtime Environment) . It provides the cross platform functionality to java.
     
  13. Collection
     
  14. Java Date
 
 
Detailed Java Course Material
 

Java Features 

  1. Case sensitivity
    What is case sensitivity:  Case sensitivity is the mechanism in which words can be differ in meaning based on different use of uppercase and lowercase letters.
      
  2. Java is Simple and platform Independent
    The concept of Write-once-run-anywhere (known as the Platform independent) is one of the important key feature of java language that makes java as the most powerful language.
      
  3. Java Enabled browsers
    Java language is the most powerful language and is widely used in the web application. Today most of the web browser are java compatible.
      
    Java Tools 
      
  4. Java Compiler
    To commence with Java programming, we must know the significance of Java Compiler.
      
  5. Java Interpreter 
    We can run Java on most platforms provided a platform must has a Java interpreter.
      
  6. Java Debugger
    Java debugger helps in finding and the fixing of bugs in Java language programs.
     
  7. Java Header File Generator
    In Java programming we need to implement some native methods. To implement these methods Javah generates C header and source files that are used by C programs to reference an Object's instance variables from native source code.
     
  8. JavaDoc
    This tool is used to generate API documentation into HTML format from Java source code.
      
  9. Applet Viewer
    Applet viewer is a command line program to run Java applets.

 Section II- Java Language

  1. Java Comments
    To comprehend any programming language, there are several kind of comments which are used. 
      
  2. Java Keywords
    There are few keywords in Java programming language. Remember, we cannot use these keywords as identifiers in the program. The keywords "const" and "goto" are reserved though, they are not being currently used.  
      
  3. Java Data Types
    Java programming language is a language in which all the variables must be declared first and then to be used i.e. to specify the name and the type of the variable. This specifies that Java is a strongly-typed programming language
     
  4. Literals
    By literal we mean any number, text, or other information that represents a value. This means what you type is what you get. We will use literals in addition to variables in Java statement. While writing a source code as a character sequence, we can specify any value as a literal such as an integer.
     
  5. Arrays
    In this section you will be introduced to the concept of Arrays in Java Programming language. You will learn how the Array class in java  helps the programmer to organize the same type of data into easily manageable format. 
     
  6. Operators
    Operators are symbols that performs some operations on one or more then one operands. Once we declare and initialize variables, we can use operators to perform certain tasks like addition, subtraction etc.
      
  7. Controlling your program
    We all know that the execution of the statements in a program takes place from top to bottom. We will learn how the different kinds of statement have different effects in looping like decision-making statements (if-then, if-then-else, switch), the looping statements (for, while, do-while), and the branching statements (break, continue, return) in Java programming language.
      
  8. Java Classes
    In this section you will be introduced to some essential classes in Java like Exceptions, Basic I/O, Concurrency etc. 
     
  9. Class Inheritance
    To know the concept of inheritance clearly you must have the idea of class and its features like methods, data members, access controls, constructors, keywords this, super etc.
     
  10. Summary
    You have been introduced to the contents of Java language providing a great amount of information. Perhaps it would be a bit arduous to grasp the whole lot of things at one go. However, the implementation of these little basics will make you a substantial programmer. 
     

Related Java Tutorials/Articles

  1. Java Tutorial and articles
    Here you will find articles related to the Java Programming Language. Some of the articles are:
    Deadlocks in Java
    , Java GC, Java Compile Time Constants, Enum Inversion Problem, Head First Design Pattern, LinkedList vs. ArrayList, Java Break to Label Statement, Strategy Pattern of Hascode Equality, Object Adapter based on Dynamic Proxy, Making Enumerations Iterable, JTable in JDK, JDK 1.5 Performance Surprises ... Click Here to View all tutorials
     
  2. Java Tutorials - Complete Java Tutorial for Beginners and Advance Programmers
  3. Java Security Packages JCA/JCE
    In this tutorial, the author explains the cryptography-related concepts and packages in JDK, with code examples. Many of the concepts and technical terms thus learnt will be useful in understanding the Cryptography API in MFC also.

    Browser All Tutorials

Latest Java News

 
 
More Tutorials
 
  1. Java API
  2. Advanced Java Tutorials

 

 
 
Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 18, 2008

Ask Questions?    Discuss: Java Example Codes and Tutorials   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
swati shriwastav
April 5, 2011
some help in programming

i've a program in library management its GUI is running but the connectivity with MS-access is not getting done. please help me as soon as possible. Here is the code
joydeep
April 8, 2011
how i run this program error???

package Student; // public class Person // { // int age; // String name; // public Person() // { // age=0; // name=""; // } // public void getPersonDetail(int newAge,String newName) // { // age=newAge; // name=newName; // } // public void putPersonDetail() // { // System.out.println("Name:"+name); // System.out.println("Age:"+age); // } // } // public interface Sports // { // public final int point=2; // public void putPoint(); // } // public class Stud extends Person implements Sports // { // int rollno; // String dept; // public Stud() // { // rollno=0; // dept=""; // } // public void getStudentDetails(int newNo, String newName,int newAge,String newDept) // { // getPersonDetail(newAge,newName); // rollno=newNo; // dept=newDept; // } // public void putStudentDetails() // { // putPersonDetail(); // System.out.println("Roll No"+rollno); // System.out.println("Department:"+dept); // putPoint(); // } // public void putPoint() // { // System.out.println("Point:"+point); // } // } // import Student.*; // class StudentDemo // { // public static void main(String args[]) // { // stud newStudent=new Stud(); // newStudent.getStudentDetail(101,"JOYDEEP",66,"JAVA"); // newStudent.putStudentDetail(); // } // }
gaurav kumar rajawat
April 9, 2011
j2se,j2ee

j2se is most programing langauge
RaSdab
April 16, 2011
access to a remote machine using IP adresse

hi all,i want to access to a remote machine using it's ip adress to recover some information of computrs like (os,ip adresse,mac adress,list of installed software,....). i I managed to recover those information but in a localhost i need your help to do that for a remote machine using java. thikks for your comments. :)
Parikshit Kansara
April 20, 2011
Regarding RMI

hi,I am working on Traveling Tournament problem project.I have already implemented this project in java. running on single system.I want implement this project in distributed environment and how i can implement this using RMI??
raju
April 21, 2011
java

java question
Java Training
April 23, 2011
Corporate Java Training

thank's for info java is strong software language..
Yogesh
April 25, 2011
java

how to use Applet in our class
yogesh
April 25, 2011
java

how to add shortct in menuitem
Hariom raval
May 23, 2011
information technology

i wnt learn what is it
khan abdul kalam``
May 23, 2011
want java training

just mail or contact me abt the java training
Irfan Ahmed
May 25, 2011
core java

How do i change background color of jLabel in swings on mouse moved and mouse out.
manish
May 26, 2011
Java Program

Create a program that represents deck of cards using object oriented approaches. Provide typical functions for utilizing a card deck.
syed
May 28, 2011
Swing and access to remote database

Hello, I want to develop a Swing database application that uses database at remote location. Please help me to develop this. It should work similar to a J2EE application. Instead of using in browser, this should run like ordinary desktop application. what are the technology to be used?.
kavita
May 28, 2011
J2EE

pLZ U provide d notes of J2EE at my email id. Thanks& regarda kavita
Saurabh Parikh
May 30, 2011
Java

Needed your contact details for Sun Java courses in Ahmedabad. Regards Saurabh
srilekha
May 31, 2011
java

sir,i need to know the procedure to apply for scja and scjp exams?
ram
June 1, 2011
java mouseevents

want code when mouse moves onto a image then we should get a checkbox type where we should have the information of the image
vikki
June 2, 2011
java

hi I am vikki from new delhi and I am preparin scjp&scwcd exam
jagath prabhu.n
June 7, 2011
java

about java
shumayla mirza
June 4, 2011
abt notes

nice notes but something more should be....
kanchan
June 7, 2011
java

nice style of teaching.Thanks. I want to know about the procedure of downloading this.
DUMINDA
June 10, 2011
for loop

its important 4 me
sue
June 15, 2011
java script program

The program will input Data of Salesman Id, Item code, and number of cuestomer. Sales id is 5digit long, and items code range from 100-300 if Item code is 100-150, display " aim high" if item code is 150-200, display "good sales" if item code is 250-300, display "excellent sales" each customer should not purchase 3 items at once final report should produce folling summary Salesman ID Item code no of customers 12356 100 1 45678 112 2 kindly advise
janardhan putta
June 18, 2011
about core java

send me about core java clearly
naresh
June 18, 2011
thanks

it very helpful for me thanks a lot sir
vandana anghan
June 20, 2011
java project

hello, i want to do project in java.Can i do my project on anti-virus engine? please guide me.
vishvambhar
June 21, 2011
java

how to create animation in core java
bhea
June 22, 2011
wla lng

nice tutorial in java lectures and cdes!!!
Moosa
June 24, 2011
ndi murwa wa ha Tshirangwana

iwould like to know more
Karthik(HYDERABAD, INDIA)
June 25, 2011
JAVA , the competing language.

I love this website . I request this site to present Java with simple examples in order of precedence of chapters.
santosh
June 25, 2011
java

it z good if u give in detail
Gaurav
June 26, 2011
Asking code

I wants to know what is the code of sun medical dictionary and what is the cost of purchasing it
uday
July 11, 2011
java

where we have to place the source code as part of your project?
N.Priyadharsini
June 30, 2011
Java

Good
shaik Abdullla
July 1, 2011
java

very nice & useful
R.senthil kumar
July 2, 2011
question about in java

//what is a output if error accured what is the reason class a { public static void main(String args[]) { byte a=10; byte b=10; byte c=a+b; System.out.println(c); } }
rosh
July 2, 2011
java

what is d/f b/w assertion & exception
kavita gupta
July 2, 2011
thanks

i like this website.
kyiminhan
August 12, 2011
I learn to java.

I'm so interest in java programming.
Manimala
August 15, 2011
Servlet

When am trying to open the servlet page , have given the class name ->next ->next ->finish.When the page is opening , showing errors. import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; (javax.servlet couldn't be resolved )like that it is showing
khan naba
August 16, 2011
project on online admission

please give me project on online admission system in java or asp.net
Pinku Borah
August 18, 2011
how to make exe of a java file

Rose india help me a lot to learn java.thanks for such a usefull site. I have develop a small software(windows application) with core java.But i want the steps for building exe of that java file.what are the steps?
Suevonne
June 15, 2013
wjaCiQErPZYtNzIq

I'm impressed you sohlud think of something like that
Md Arif
August 23, 2011
Java programs

I need all program of java
M.NIKHILA
August 24, 2011
corejava

i have sum questions
pgr
August 27, 2011
Printing BinaryTree

How to print array values in a binary tree form?
malli
August 27, 2011
core java

i won to simple programs
Yashwanth
August 31, 2011
Thanks to Roseindia

I would really like to thank Roseindia for its continuous and valuable effort to make the contents better. As a regular user i will say It's really a good source of knowledge for any kind of users(S/W). Thanks a lot.
priyapanner
June 4, 2013
hi.about java

i want to interest learn java.what is basic for java?.it's esay or difficult?,how to learn java,how to take step to learn easily?plz,help .give ans my email...........
m.jayashree
September 10, 2011
respected sir

difference between java and c++? what is meant by object oriented progrmming java?
Ravi Kokacha
September 12, 2011
java programing

providing
daminee
September 15, 2011
plastic

give me a project of sales management system otherwise i tell to all my friends no body search this site
Tanmaya Kumar Sahu
September 15, 2011
Java Monthly Magazine

I want monthly magazine of java from sun.
Vergin sheeba
September 17, 2011
java

This java tutorials is very use full to the students
xyz
May 22, 2013
java

---util--- public class connect { public String server = "jdbc:mysql://localhost/form"; String userName = "root"; String password = "root"; Connection con=null; public Connection getConnection() { try { Class.forName("com.mysql.jdbc.Driver"); con = (Connection)DriverManager.getConnection(server, userName, password); } catch (Exception e) { System.out.println("" + e.toString()); } return con; }
xyz
May 22, 2013
java

--DAO--- public boolean insertData(form1 rg) { try { //PrintWriter out = response.getWriter(); Connection con = new connect().getConnection(); PreparedStatement ps = con.prepareStatement("insert into form1 values('" + rg.getName() + "','" + rg.getGender() + "','" + rg.getHobbies() + "','"+rg.getCity()+"','"+rg.getAddress()+"','"+rg.getUsername()+"','"+rg.getPassword()+"')"); ps.executeUpdate(); return true; } catch(SQLException e){ return false; } catch (Exception ex) { return false; }
xyz
May 22, 2013
java

--manager-- public boolean insertData(String name,String gender, String hobbies, String city, String address,String username,String password) { form1 rg = new form1(); rg.setName(name); rg.setGender(gender); rg.setHobbies(hobbies); rg.setCity(city); rg.setAddress(address); rg.setUsername(username); rg.setPassword(password); boolean b= new form1DAO().insertData(rg); if(b==true) { return true; } else{ return false; } }
xyz
May 22, 2013
java

--servlet-- PrintWriter out = response.getWriter(); String name = request.getParameter("name"); String gender = request.getParameter("gender"); String hobbies = request.getParameter("hobby"); String city = request.getParameter("cities"); String address = request.getParameter("address"); String username = request.getParameter("username"); String password = request.getParameter("password"); formManager rm = new formManager(); boolean b=rm.insertData(name,gender, hobbies, city,address,username,password); if(b==true){ out.print("<script> alert('yes') </script>"); } else{ out.print("<script> alert('no') </script>");}
dlarej
September 20, 2011
java

,nice web
BIDYUT DALAL
September 21, 2011
java language

add two number without classs
piyush
September 25, 2011
is void type is fixed for main() in java???

public static int main(String[] args) is this right(above) instead of public static void main(String args[])..
sanoj
September 27, 2011
j2ee tutorials

great
sukhendu rana
September 29, 2011
Help in understanding the flow of learning.

Sir/Madam, I am very keen to learn Java. Although your website has helped me emmensly with the 'New to Java' section, I want to learn further and slowly get expertise with the help of your website. Hence, I would like to know the process/flow to learn Java. I am getting confused with so many links. Could you please provide me the step by step links/Tutorials which I should follow in order to become a Java/J2EE professional. Any help would be greatly appreciated. Thank you. Sukhendu.
asma
October 2, 2011
jquestion about java

how to write one simple java program that will open any three programs at the same time ?
Gemma Delos Santos
October 3, 2011
Object-Oriented Programming

., It's difficult to program .,
Rohit VAiragkar
October 4, 2011
Deployment

How to deploy a .java file? I don't want to deploy on a server,only to a single machine.
vaibhav
October 5, 2011
features

great knowledge of java featuers in this site
mayank rajpoot
February 20, 2013
java core

this solution i am stisff
Ortega
October 19, 2011
java tutorial

write a java application for a video club that must do the following; 1)register new members 2)register new videos 3)be able to rent out or borrow videos 4)search videos from the database
santhu
October 22, 2011
Java Basics

Please send me Advanced Java Concepts. Thanks in Advance.
sudhakar
October 22, 2011
want some detais about java

some details
Stop 0x00000124
October 24, 2011
Hi

Great tutorial i really learn a lot of things from this blog. Thanks for sharing
pomma
January 29, 2013
one question

list the difference between extend and implements keywords>example program
tariku adam
November 1, 2011
project on university student managment system

i want aid,than u.
dungar mal
November 2, 2011
IT

wants download
ravi
November 8, 2011
what i interface?

send me answer
sathyam
November 10, 2011
java

this web site imprves the knowldge through the communication with diff person
Seshu
February 23, 2013
Passing inputs to a jar file through a file

Hi i've Jar file which runs successfully with built in inputs. But i want to give inputs to the jar file through a file..can anyone explain?
Surya Krishna Bharath
November 16, 2011
doubt in ASCII

hi sir/madam i need your information that when 9 is char then it's ASCII is "57" is it posible to find that what is the ASCII value for "99"as a char. sorry sir i am not able ask correctly what my doubt was ,so please excuse me and send me replay
jyotsna
November 17, 2011
java

Iwant to learn adv java nad some topics in core java
swati panth
November 19, 2011
all the programs of java with their outputs

program should not be complicated. Easy to understand
Aryan Raj
November 23, 2011
About java

Actually i am very impresed to online java tutorials
Laura
November 24, 2011
Help in writing a program

I am just wondering how to write a program that finds the first palindromic prime number above 100,000 and i have to Include the value of this prime in a comment at the start of the code.
Raghav Dang
November 24, 2011
computer

cool
Vasuneet
November 24, 2011
java

just lovely :P
jitender
November 24, 2011
Java

It's good
Krish
November 26, 2011
Java netbeans

I'm a student of grade 9 and i hope this site will help me learn Java
Deepak
November 28, 2011
nice Post

Nice work guys. www.de-tutorials.com
pavan
November 28, 2011
java

it is good
rudrasivaprasad
December 1, 2011
ss

give more programming examples with simple logic
rudrasivaprasad
December 1, 2011
sub

plz give easy examples to understood
pradeep karanjule
December 2, 2011
project on email system in java

what is mean the jsp servlet and how we convert jsp files into php and java
ramuk
December 9, 2011
j2ee

Patient patientobj=new Patient() ; Patient patientobj1=new Patient(); Patient_dao patientdaoobj=new Patient_dao(); String name=request.getParameter("patientname"); String disease=request.getParameter("diseasename"); int wardNo=Integer.parseInt(request.getParameter("wardnumber")); patientobj.setPatientname(name); patientobj.setDiseasename(disease); patientobj.setWardnumber(wardNo); patientdaoobj.insert(patientobj); ArrayList list =patientdaoobj.view(patientobj1); request.setAttribute("data",list); RequestDispatcher rd=request.getRequestDispatcher("/view.jsp"); rd.forward(request,response);
naresh
December 17, 2011
what is java mail....

pls ans
ajay
December 23, 2011
java

Java is object
pratim
December 28, 2011
visul basic 6

How to give connection to MS access database to disply name in text boxes from database
qaseh
January 4, 2012
help me

you are required to develop a simulation program on array-based list. The array can store up to maximum ten integer or string values.The application should be able to perform basic operations such as inserting,deleting and displaying the array's content. any extra operations are welcome.The application should prompt user a menu. you are free to perform either forward or backward approach for inserting process.for deleting purposes remove the most front element in the list.
jaya
January 4, 2012
java

java is advanced program
captainportal
January 9, 2012
java

good site
gowri sankar
January 12, 2012
thanks for java desinging team

hi team i am learning java language... very useful this website tank you
Stella
January 15, 2013


could you please send the C-pgrm code for the mirror image of floyd's triangle
Stella
January 15, 2013
c-pgrm code

could you please send the C-pgrm code for the mirror image of floyd's triangle
vinitha vasudevan
January 13, 2012
java syllabus

get me a latest programs in it
kundan kumar
January 17, 2012
Final Publication Certificate

i want to java developer
harish.k
January 17, 2012
how to update?

package com.tcs.ilp.usermanagement.DAO; import java.sql.Connection; import java.sql.Statement; import com.tcs.ilp.usermanagement.bean.StudentViewBean; import com.tcs.ilp.usermanagement.connection.ConnectionManager; /** * StudentUpdateDAO * @author 539064 * */ public class StudentUpdateDAO { static Connection currentCon = null; public static StudentViewBean update(StudentViewBean bean) { //preparing some objects for connection Statement stmt = null; String email = bean.getEmail(); String address=bean.getAddress(); String mobileno=bean.getMobileno(); String username=bean.getUsername(); System.out.println(username); String s ="update student set email='"+email+"',address='"+address+"',mobileno='"+mobileno+"' where username='"+username+"'"; // "System.out.println" prints in the console; Normally used to trace the process try { //connect to DB currentCon = ConnectionManager.getConnection(); stmt=currentCon.createStatement(); stmt.executeQuery(s); stmt.executeQuery("commit"); bean.setValid(true); } catch (Exception ex) { System.out.println("update failed: An Exception has occurred! " + ex); } //some exception handling finally { if (stmt != null) { try { stmt.close(); } catch (Exception e) {} stmt = null; } if (currentCon != null) { try { currentCon.close(); } catch (Exception e) { } currentCon = null; } } return bean; } }
Sandesh
January 18, 2012
javamail help

Hello experts, i am trying to read mail from gmail, which is working perfectly in the local machine. but when I update the server i am getting the following error . javax.mail.MessagingException: Connect failed; nested exception is: java.net.ConnectException: Connection timed outfalse The Code i am using is : Session session = Session.getDefaultInstance(props, null); Store store = session.getStore("imaps"); store.connect("imap.gmail.com", "<username>", "password"); System.out.println(store); Folder inbox = store.getFolder("Inbox"); inbox.open(Folder.READ_ONLY); Message messages[] = inbox.getMessages(); for(Message message:messages) { System.out.println(message); }
surender
January 19, 2012
surender

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <html> <head> <title>UIViewRoot</title> </head> <body bgcolor="#ffffff"> <h1>UIViewRoot example</h1> <f:view> <h:outputLabel for="validatorInput"> <h:outputText value="Enter text:"/> </h:outputLabel> <h:inputText id="myOtherInput"> <f:validateLength minimum="0" maximum="3"/> <f:validateLongRange minimum="1" maximum="100"/> </h:inputText> <h:message for="myOtherInput" showDetail="true" showSummary="true" warnStyle="color: green" infoStyle="color: blue" errorStyle="color: red"/> <br><br> <h:panelGroup id="myGroup" styleClass="table-background"> <h:graphicImage url="images/hello.gif"/> <h:outputText value="Column 1"/> <h:outputText value="Column 2"/> </h:panelGroup> <h:panelGrid columns="3" cellpadding="1" border="1" width="40%"> <h:outputText value="(1,1)"/> <h:outputText value="(1,2)"/> <h:outputText value="(1,3)"/> <h:outputText value="(2,1)"/> <h:outputText value="(2,2)"/> <h:outputText value="(2,3)"/> </h:panelGrid> <h:panelGrid columns="4" styleClass="table-background" headerClass="page-header" columnClasses="table-odd-column, table-even-column" footerClass="table-footer" cellpadding="1" border="1" width="40%"> <f:facet name="header"> <h:panelGroup> <h:outputText value="This is a sample header."/> </h:panelGroup> </f:facet> <h:outputText value="(1,1)"/> <h:outputText value="(1,2)"/> <h:outputText value="(1,3)"/> <h:outputText value="(1,4)"/> <h:outputText value="(2,1)"/> <h:outputText value="(2,2)"/> <h:outputText value="(2,3)"/> <h:outputText value="(2,4)"/> <h:outputText value="(3,1)"/> <h:outputText value="(3,2)"/> <h:outputText value="(3,3)"/> <h:outputText value="(3,4)"/> <f:facet name="footer"> <h:outputText value="This is the footer."/> </f:facet> </h:panelGrid> </f:view> </body> </html>
Bal pawar
January 20, 2012
java referance

i want to lear java technologies withen one month it is possible?
Jayapal ReddyM
January 21, 2012
Java using MS Word

Is it possible to develop java code using MS Word, if possible what are necessary settings required in MS Word Editior
Jayapal ReddyM
January 21, 2012
Java using MS Word

Is it possible to develop java code using MS Word, if possible what are necessary settings required in MS Word Editior
Jayapal ReddyM
January 21, 2012
Java using MS Word

Is it possible to develop java code using MS Word, if possible what are necessary settings required in MS Word Editior
Jayapal ReddyM
January 21, 2012
Java using MS Word

Is it possible to develop java code using MS Word, if possible what are necessary settings required in MS Word Editior
Naresh
January 21, 2012
database

how to retrieve the table data in oracle using core java fundamentals
Bernard Clark
January 22, 2012
Adding a sound file to a java applet

I tried to post a question about adding a sound file to an applet, tried to send the program but couldn't seem to get past the sign in page
Sushma
January 26, 2012
Java program to write string in triangular form.

i want to know the logic of writing a java program for the string in triangular form. For example 'my name is sushma' is a string i have write java program to display the name in triangular form.
p satish
January 26, 2012
java save n complation

hi sir i have written the program saving it with the same class name n when i am executing it is showing unable to read the file . what should i have to do ?
Tyya
January 19, 2013
vYcuSMKlSHpy

That's an inegnoius way of thinking about it.
RAJESH
January 31, 2012
i want coding with output

How to create the login and password in java programming?
RAJESH
January 31, 2012
i want coding with output

how to learn swing components with example and output?
RAJESH
January 31, 2012
i want coding with output

FRIENDLY FUNCTION PROGRAM WITH OUTPUT
rukmangad
January 31, 2012
java programming

java language is very popular.
abhay singh
February 1, 2012
java Example

Project Code Java Example Codes
Ganesh Rahinj
January 11, 2013
java stringlength

import java.lang.*; import java.io.*; class StringLength { public static void main(String[] args) throws IOException { System.out.println("String lenght example!"); BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter string:"); String str = bf.readLine(); int len = str.length(); System.out.println("String lenght : " + len); } }
kalel rahuman
February 6, 2012
java

no cmd
Jayapal Reddy
February 7, 2012
Java - downcasting

Create an abstract class with no methods. Derive a class and add a method. Create a static method that takes a reference to the base class, downcasts it to the derived class, and calls the method. In main( ), demonstrate that it works. Now put the abstract declaration for the method in the base class, thus eliminating the need for the downcast.
thanush.m
February 10, 2012
java developer..

simple program my mail send,, me,,, friend...
R.devipriya
January 19, 2013
thank u

need java full package from the basics i kindly request you to send mail to the above email id... from this i like to learn java fully
Lucas
January 19, 2013
afvNwkFPsji

Actually I really watend to make Phage Wars 2 Multiplayer but I didn't have the means to host a server. In the end I decided to focus on features instead of multiplayer.I would really like to revisit this game and add more RTS features as I think the Flash Industry needs a few more RTS games. I've done Multiplayer games in the past and this game gets more requests for multiplayer than any other. I definitely want to add a third but I think I will have to wait until Multiplayer is more of a possibility before doing so.
Sinrahenrianto
January 19, 2013
xjrSitQTlZ

above i think multi-player phage wars would be the best yet. although if you do make a phage wars 3 and it doesn't have multi-player i think the next best thing you could do would be to make a story line. seiothmng like an experimental drug has been injected into a human host and now has to take it over while combating obstacles like while blood cells and the lymph nodes and such. not THAT would make my day, but ether way you make some amazing games keep up the great work. also i think it would be cool to see like a player created map pack of demolition city, or more maps or seiothmng. that's a pretty fun game as well.
SHIKHA
February 12, 2012
Core java

i have gone through then the tutorial of java and i felt that it is very much beneficial for the students who are beginning to study core java.
shikha
February 12, 2012
about c &c++

thanku for providing help but i want tto know that can u help us in c&c++ by providing such tutorials. if u can do this theni m very thankful to u.
jelani basha
February 14, 2012
java

what is the difference between an abstract class and interface
gourav patil
February 14, 2012
about java language in industries

I am an engineering student of 3rd year. I am preaparing for java from next 2 semesters,I desided that I only prepare for java nothing else so it is good for me as java provide me aportunities in feture for jobs & if provides so what they are & in whose sector........
Krishna
February 16, 2012
online registration

Hi, i want to register for your different course provided online. kindly let me know how can i register and access the course. Regards, Krishna
Sharan
February 22, 2012
Need help

I need help in writing this. If anyone can help that would be appreciated. Implement a Singly Linked List in Java. Use this program to develop the following application. This application accepts from console and stores a list of 10 names of your friends in the Singly Linked List. The order of arrival of these names determines the sequence of names in the linked list. Implement a method that sorts the original sequence into a new sequence based on the alphabetical order of the names.
mohan
February 28, 2012
java

java
shabeer
March 8, 2012
sms server

how i can create a sms server in java that sends sms from a java desktop application to mobile phone using via a usb cable connction in mobile or messaging by bluetooth
swetha
March 10, 2012
java concepts

good
Alexwhite
March 10, 2012
Thanks

Thanks for such nice tutorials. Helped me alot.
Niko Neal Farinas
March 12, 2012
Java Programming

1. write a program that reads a number greater than or equal to 1000 from the user and prints it out with a comma separating the thousands. 2. then the reverse of it.. please i need it tommorow of a day after tommorow
Aadil Khan
March 14, 2012
JAVA Training

Hi There, I have completed my Engineering last year and I am very interested in becoming an Android Developer. I understand that for this I have to start with JAVA developors course which I was able to browse through your site. Can you send me more info on this course and the future prospects on getting into Android development. I would appreciate if you could let me knwo the training costs and also when the fresh batch starts. Thanks and I hope for an early response from you. Regards, Aadil Khan
Suresh
March 14, 2012
java

nice tutorial
Bhavya
March 14, 2012
java

nice one
selin simon
March 15, 2012
about java,web,html,

describe with example this all thing.
sushmita shukla
March 17, 2012
JAVA DEVELOPER NEEDS.

what must be a java developer need? requirements to become java developer?
K.Aswani
March 20, 2012
java

This site is Excellent in learning.
jayesh
March 21, 2012
java

any
Rita
March 23, 2012
Java Help!

Hi, i really need somebody help help. i have tried so hard to program it but i just cant do it. model a student object. The student object has the following attributes: First_name, Last_name, Student_Id. // ways to identify each student 4 subjects and each subject will hold 10 marks Subject_one, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9 Subject_two, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9 Subject_three, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9 Subject_four, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9 Your methods for the student class must include but are not limited to: Get_first_name, Get_last_name, Get_Student_Id. // will print or return the data. Get_Subject_1, Get_Subject_2, Get_Subject_3, Get_Subject_4. Display_Subject_1, Display _Subject_2, Display _Subject_3, Display _Subject_4. Get_Subject_mark[specific mark] //will display the specified mark. Get_Subject_all_marks // will display all 10 marks and the subject name. Get_overall_average, // will get the average for all 40 marks. Get_Subject_average// will get the average for any 1 subject.
thivja
March 23, 2012
java

good
agilan
March 25, 2012
java

i want project on college management system using java coding
Immi
April 3, 2012
Core java and Advanced java

is it possible to learn core and advance java in 2 months time at an NIIT centre 2-3 hrs a day / 6 days a week?
luqman
April 6, 2012
computer science

it is a good way of learning
Mounika
April 6, 2012
classes and interfaces in java

Im Unable to find all interfaces and classes of java through command prompt.. can any one, pls help me in tracing out.. i tried to type javap java.lang.* but it doesnt work.im able to see only methods in a class,,but how can i get intrfaces and classes..??
farooq ahmed pirzado
April 6, 2012
intrested in J2SE..J2EE.. and Networking

this site is so good .. i like .. and help me more ...
Manoj Kumar Patel
April 17, 2012
Need Solution For Below Qn.

Words in English are separated by delimiters such as colon (:), semi-colon (;), fullstop(.), question mark(?), space( ), hyphen(-), new line(\n), exclamation(!) and comma(,). In this problem, a java class MyDocument is present that has a method: Method 1: alphabetOccurrence (), counts number of occurrence of an alphabet. The Main Class demonstrates the use of MyDocument class. I need code to implement the below method: 1. alphabetOccurrence () Complete Program: import java.util.*; class Main { public static void main(String[] args) { MyDocument document = null; String text; text = "good morning. Good morning Alexander. How many people are there in your country? Do all of them have big houses, big cars? Do all of them eat good food?" ; char letter = 'd'; document = new MyDocument(); document.setDocumentText(text); System.out.println("Letter " + letter + " has occured " + document.alphabetOccurrence(letter) + " times"); } } class MyDocument { private ArrayList<Character> document = new ArrayList(); public MyDocument() { } void setDocumentText(String s) { for(int i = 0; i < s.length(); i++) document.add(s.charAt(i)); } ArrayList getDocumentText() { return this.document; } public int alphabetOccurrence(char letter){ return 0; } }
shravankumar
April 20, 2012
java

i feel happy with this thank you.
Gopal Mohata
April 21, 2012
About site

Rose India excellent site,My best site
Princelin
April 25, 2012
JAVA

Kindly send me the updates
Mandeep Kumar Jain
April 27, 2012
To upload contractor's tenders through my LT

Sir, I am in need to install into my lap top vide which I may be able to upload the tenders of various contractors on the site e-tenders.hry.nic.in for the works related to Haryana Irrigation Department. Thanks
svrmurthy
May 6, 2012
about the details of project

sir,we r doing "students admission in colleges" project wat is the requirements of this project please mail to me sir...
nazia ali
May 7, 2012
change in input methodology

plz give a discription along wid the programs so that beginners know that where are variables,.,.where are constructors,.,.etc etc,.,.
mahesh
May 10, 2012
MCQ

i think roseindia provide MCQ.......
GOVINDRAJ
May 23, 2012
java study need vidio file

i need vidio file basic java totorial
prakash
June 12, 2012
java

what is the difference between getActionCommand() and getSource()
jenish patel
June 17, 2012
to know about java

hi, i am student of computer engg. i am in 1st year.i want to know that what is java??
Shafi Chaudhry
June 19, 2012
How to print on dot matrix printer in Java.

Hello, I want to printed text on EPSON 300-ii printer, but do not know how? help me. Thanks
savitha
June 20, 2012
java

no comments
ganga
June 20, 2012
java

no idea
palak
June 20, 2012
spend analysis

hiiiiiiiiii My project is spend analysis. how to connect one page to another page ? like my 1st page is employee detail &there are one button ,when i click this button the next page page.
Deepak
June 22, 2012
Java Jazz Up

Dear Authors, Is the magazine is no more getting published? It is a good learning resource.
fafa
June 28, 2012
drawing shapes

I want a code for drawing several shapes with java
veenu
June 29, 2012
java

j2ee concepts
sandeep ghuge
July 10, 2012
Java Or php projects for final year students

hello, can anyone help me for a good java OR php project topic or sample projects, good websites ect. Thanks in advance.
roshan d vasava
July 18, 2012
online university management system project

Please give help of my project......
vasava rooshan
July 18, 2012
online universty management system Project

Pleas help of my project......
akanksha agarwal
July 19, 2012
core java

sir i want source code of online examination test.. m unable to get it.. so plz help me.. i hav 2 submit my project....
G.Srinivasarao
July 20, 2012
Java

to find the Sum of first natural numbers?
sajjad
July 31, 2012
like it

the best site in field of java i get very nice info thanks................................
stephen
August 1, 2012
my qustion

why using java programming
Mohd Arshad
August 4, 2012
java

it's very helpfull.
sarthak pandya
August 6, 2012
java project

i am doing java project so how can i started with it
dinesh
August 7, 2012
core java

matrix program
Divya
August 16, 2012
Java

Nice materials
jeevan
August 21, 2012
about .jar files

please put the .jar files and tell me how to create .jar file with meta-inf.
popo
August 21, 2012
popo

import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class Main { public static void main(String[] args) { try { // Set cross-platform Java L&F (also called "Metal") UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (UnsupportedLookAndFeelException e) { // handle exception } catch (ClassNotFoundException e) { // handle exception } catch (InstantiationException e) { // handle exception } catch (IllegalAccessException e) { // handle exception } javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { new WellForm(); // Create and show the GUI. } }); } } ______________________________________________________________________________________________________________________- import java.awt.BasicStroke; import java.awt.Color; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import java.awt.color.CMMException; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; import java.text.DecimalFormat; import java.util.ArrayList; import javax.swing.JPanel; public class Canvas extends JPanel implements MouseMotionListener, MouseListener { private ArrayList<WellData> wellList; int selectIndex; Double valuesOfX[], valuesOfY[], propertyArray[]; int majorTics = 10, minorTics = 5; //double yTicsIncrValue = 0, xTicsIncrValue = 0; double height, width, leftInsect, bottomInsect; double pressX; double pressY; double releaseX; double releaseY; double draggedX; double draggedY; Graphics2D g2d; Rectangle2D.Double clipRectangle; double xMin, xMax, yMin, yMax; // double xMinTest, xMaxTest, yMinTest, yMaxTest; // private Point point = null, pressedPt = null, releasedPt = null; //private boolean isZoom = false, isDragged = false; public Canvas() { repaint(); } public void setWellList(ArrayList<WellData> wellList) { this.wellList = wellList; addMouseMotionListener(this); addMouseListener(this); initVal(); } public void setSelectIndex(int selectIndex) { this.selectIndex = selectIndex; } private void initVal() { valuesOfX = new Double[wellList.size()]; valuesOfY = new Double[wellList.size()]; for (int j = 0; j < wellList.size(); j++) { valuesOfX[j] = wellList.get(j).getX(); valuesOfY[j] = wellList.get(j).getY(); } xMin = getMin(valuesOfX); xMax = getMax(valuesOfX); yMin = getMin(valuesOfY); yMax = getMax(valuesOfY); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g2d = (Graphics2D) g; if (wellList != null) { propertyArray = new Double[wellList.size()]; // valuesOfX = new Double[wellList.size()]; // valuesOfY = new Double[wellList.size()]; double radius = 0, x = 0, y = 0; height = this.getHeight(); width = this.getWidth(); leftInsect = width / 20; bottomInsect = height / 10; clipRectangle = new Rectangle2D.Double(leftInsect, bottomInsect, width - leftInsect * 2, height - bottomInsect * 2); g2d.draw(clipRectangle); g2d.setClip(clipRectangle); for (int j = 0; j < wellList.size(); j++) { propertyArray[j] = wellList.get(j).getProperty() .get(selectIndex); } // for (int j = 0; j < wellList.size(); j++) { // valuesOfX[j] = wellList.get(j).getX(); // } // for (int j = 0; j < wellList.size(); j++) { // valuesOfY[j] = wellList.get(j).getY(); // } for (int i = 0; i < wellList.size(); i++) { radius = (propertyArray[i] * getPropertyFactor()) * 500; double factorX = (clipRectangle.getWidth()) / (xMax - xMin); double factorY = (clipRectangle.getHeight()) / (yMax - yMin); x = clipRectangle.getX() + ((wellList.get(i).getX() - xMin) * factorX); y = (getHeight() - clipRectangle.getY()) - ((wellList.get(i).getY() - yMin) * factorY); Ellipse2D.Double circle = new Ellipse2D.Double(x - radius / 2, y - radius / 2, radius, radius); if (selectIndex == 0) { g2d.setPaint(Color.RED); } if (selectIndex == 1) { g2d.setPaint(Color.MAGENTA); } if (selectIndex == 2) { g2d.setPaint(Color.BLUE); } g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.draw(circle); g2d.setPaint(Color.BLACK); g2d.fill(new Ellipse2D.Double((x), (y), 3, 3)); g2d.drawString(wellList.get(i).getWellName(), (float) (x), (float) (y)); } g2d.draw(new Rectangle2D.Double(pressX, pressY, draggedX - pressX, draggedY - pressY)); // margin Lines // g2d.setPaint(Color.BLACK); // // X-axis // g2d.draw(new Line2D.Double(leftInsect, (height - // bottomInsect), // width, (height - bottomInsect))); // // //Y-axis // g2d.draw(new Line2D.Double(leftInsect, 0, leftInsect, // (height - bottomInsect))); g2d.setClip(null); g2d.setStroke(new BasicStroke(1.5f)); xTics(); yTics(); } } void yTics() { double yTicsIncrValue = 0; for (int t = 1; t <= majorTics; t++) { // g2d.setPaint(Color.BLACK); // g2d.draw(new Line2D.Double(leftInsect - 10, bottomInsect // + (yTicsIncrValue * getFactorY()), leftInsect + 10, // bottomInsect + (yTicsIncrValue * getFactorY()))); // // DecimalFormat formatter = new DecimalFormat("#0.000"); // g2d.setPaint(Color.MAGENTA); // g2d.drawString( // /* "Tic: " +(10-t) + */" " // + formatter.format((yMin + yTicsIncrValue)), // (float) (leftInsect - 45), // // (float) (clipRectangle.getMaxY() - yTicsIncrValue // * getFactorY())); // // yTicsIncrValue = yTicsIncrValue + (yMax - yMin) / (majorTics - // 1); /*************************************/ double factorY = (clipRectangle.getHeight()) / (yMax - yMin); g2d.setPaint(Color.BLACK); g2d.draw(new Line2D.Double(leftInsect - 10, bottomInsect + (yTicsIncrValue * factorY), leftInsect + 10, bottomInsect + (yTicsIncrValue * factorY))); DecimalFormat formatter = new DecimalFormat("#0.000"); g2d.setPaint(Color.MAGENTA); g2d.drawString( /* "Tic: " +(10-t) + */" " + formatter.format((yMin + yTicsIncrValue)), (float) (leftInsect - 45), (float) (clipRectangle.getMaxY() - yTicsIncrValue * factorY)); yTicsIncrValue = yTicsIncrValue + (yMax - yMin) / (majorTics - 1); /**************************************/ } } void xTics() { double xTicsIncrValue = 0; for (int t = 1; t <= majorTics; t++) { // g2d.setPaint(Color.BLACK); // g2d.draw(new Line2D.Double(leftInsect + xTicsIncrValue // * getFactorX(), height - bottomInsect - 10, leftInsect // + xTicsIncrValue * getFactorX(), height - bottomInsect + 10)); // // DecimalFormat formatter = new DecimalFormat("#0.000"); // g2d.setPaint(Color.GRAY); // g2d.drawString(" " + formatter.format((xMin + xTicsIncrValue)), // (float) (leftInsect + xTicsIncrValue * getFactorX()), // (float) (clipRectangle.getMaxY() + 40)); // // xTicsIncrValue = xTicsIncrValue + (xMax - xMin) / (majorTics - // 1); /*********************/ double factorX = (clipRectangle.getWidth()) / (xMax - xMin); g2d.setPaint(Color.BLACK); g2d.draw(new Line2D.Double(leftInsect + xTicsIncrValue * factorX, height - bottomInsect - 10, leftInsect + xTicsIncrValue * (factorX), height - bottomInsect + 10)); DecimalFormat formatter = new DecimalFormat("#0.000"); g2d.setPaint(Color.GRAY); g2d.drawString(" " + formatter.format((xMin + xTicsIncrValue)), (float) (leftInsect + xTicsIncrValue * factorX), (float) (clipRectangle.getMaxY() + 40)); xTicsIncrValue = xTicsIncrValue + (xMax - xMin) / (majorTics - 1); /*********************/ } } Double getMax(Double arr[]) { Double max, arrayX[] = arr; max = arrayX[0]; for (int i = 1; i < arrayX.length; i++) { if (arrayX[i] >= max) { max = arrayX[i]; } } return max; } Double getMin(Double arr[]) { Double min, arrayX[] = arr; min = arrayX[0]; for (int i = 1; i < arrayX.length; i++) { if (arrayX[i] <= min) { min = arrayX[i]; } } return min; } Double getFactorX() { Double maxX, minX; Double factorX = null; maxX = getMax(valuesOfX); minX = getMin(valuesOfX); factorX = (clipRectangle.getWidth()) / (maxX - minX); return factorX; } Double getFactorY() { Double maxY, minY, factorY = null; maxY = getMax(valuesOfY); minY = getMin(valuesOfY); factorY = (clipRectangle.getHeight()) / (maxY - minY); return factorY; } Double getPropertyFactor() { Double max, min, factor = null; max = getMax(propertyArray); min = getMin(propertyArray); factor = (clipRectangle.getWidth()) / (max - min); return factor / 10000; } @Override public void mouseClicked(MouseEvent e) { // System.out.println("mouseClicked"); } @Override public void mousePressed(MouseEvent e) { pressX = e.getX(); pressY = e.getY(); System.out.println("mouse press X-- "+((((e.getX()-clipRectangle.getX()))/getFactorX())+xMin)); System.out.println("mouse press y-- "+((((getHeight()-e.getY()-clipRectangle.getY())/getFactorY()))+yMin)); } @Override public void mouseReleased(MouseEvent e) { releaseX = e.getX(); releaseY = e.getY(); if(pressX<releaseX) { xMin=(((pressX-clipRectangle.getX()))/getFactorX())+xMin; yMax=(((getHeight()-pressY-clipRectangle.getY())/getFactorY()))+yMin; xMax=(((releaseX-clipRectangle.getX()))/getFactorX())+xMin; yMin=(((getHeight()-releaseY-clipRectangle.getY())/getFactorY()))+yMin; } else { xMin = getMin(valuesOfX); xMax = getMax(valuesOfX); yMin = getMin(valuesOfY); yMax = getMax(valuesOfY); } repaint(); } @Override public void mouseEntered(MouseEvent e) { // System.out.println("mouseEntered"); } @Override public void mouseExited(MouseEvent e) { // System.out.println("mouseExited"); } @Override public void mouseDragged(MouseEvent e) { draggedX = e.getX(); draggedY = e.getY(); repaint(); } @Override public void mouseMoved(MouseEvent e) { } } ________________________________________________________________________________________________________________________ import java.util.ArrayList; public class WellData { private String wellName; private double x; private double y; private ArrayList<Double> property; public double getX() { return x; } public double getY() { return y; } public ArrayList<Double> getProperty() { return property; } public void setProperty(ArrayList<Double> property) { this.property = property; } public String getWellName() { return wellName; } public void setX(double x) { this.x = x; } public void setY(double y) { this.y = y; } public void setWellName(String wellName) { this.wellName = wellName; } } ________________________________________________________________________________________________________________________ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.ArrayList; import java.util.StringTokenizer; import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; public class WellForm implements ActionListener { JFrame frame; Container con; /*** menu item for reading well data */ JMenuItem wellData; WellData well; Canvas canvas; ArrayList<WellData> wellList; JComboBox<String> cmbProperty; ArrayList<Double> property; public WellForm() { createGUI(); importFile(); } void createGUI() { frame = new JFrame("2D"); // creating menu JMenuBar menuBar = new JMenuBar(); JMenu importMenu = new JMenu("Import"); wellData = new JMenuItem("Well Data"); importMenu.add(wellData); menuBar.add(importMenu); frame.setJMenuBar(menuBar); // creating property panel with label and combo JPanel northPanel = new JPanel(); JLabel lbProperty = new JLabel("Select Property"); // property = null; cmbProperty = new JComboBox<String>(); cmbProperty.setEnabled(false); cmbProperty.setActionCommand("Property_Name"); northPanel.add(lbProperty); northPanel.add(cmbProperty); // creating canvas panel canvas = new Canvas(); canvas.setBackground(Color.white); con = frame.getContentPane(); canvas.setFocusable(true); con.add(canvas, BorderLayout.CENTER); con.add(northPanel, BorderLayout.NORTH); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); } private void importFile() { wellData.addActionListener(this); cmbProperty.addActionListener(this); } @Override public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Well Data")) { wellList = new ArrayList<WellData>(); JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(null); if (returnVal == JFileChooser.APPROVE_OPTION) { File f = chooser.getSelectedFile(); BufferedReader br; try { br = new BufferedReader(new FileReader(f)); String st = ""; int counter = 1; while ((st = br.readLine()) != null) { counter++; StringTokenizer stringTokenizer = new StringTokenizer( st); if (counter >= 5 && counter < 8) { for (int i = 0; i < 3; i++) { while (stringTokenizer.hasMoreTokens()) { cmbProperty.addItem(stringTokenizer .nextToken()); } } } if (counter >= 8) { well = new WellData(); property = new ArrayList<Double>(); for (int i = 0; i <= stringTokenizer.countTokens(); i++) { while (stringTokenizer.hasMoreTokens()) { well.setWellName(stringTokenizer .nextToken()); well.setX(Double .parseDouble(stringTokenizer .nextToken())); well.setY(Double .parseDouble(stringTokenizer .nextToken())); property.add(Double .parseDouble(stringTokenizer .nextToken()));// property1 property.add(Double .parseDouble(stringTokenizer .nextToken()));// property2 property.add(Double .parseDouble(stringTokenizer .nextToken()));// property3 well.setProperty(property); wellList.add(well); cmbProperty.setEnabled(true); } } } } canvas.setWellList(wellList); } catch (Exception ae) { ae.printStackTrace(); } } }// end if if (e.getActionCommand().equals("Property_Name")) { int c = cmbProperty.getSelectedIndex(); canvas.setSelectIndex(c); canvas.removeAll(); canvas.repaint(); } } }
sarthak
August 24, 2012
notes download

pls download
Arav Kumar
August 24, 2012
java

what is API?
nandhini
September 5, 2012
java

hi i want to know notes on stub,skeleton pls give me answer
zaid
September 9, 2012
java

I have downloaded a project on library management system in core java and it is also working but it is not connecting with database which is with jdbc and odbc. An exception is coming which is java.sql.SQLException:[Microsoft][ODBC Driver Manager] The specified DNS contains an architecture mismatch between the Driver and Application
Madhusudhan
September 13, 2012
java

How to searh for learning java audio and video files, pls send me the java audio files i required.
ramana
September 15, 2012
why Runnable interface isn't markerinterface?

is good
devendra singh
September 19, 2012
html, css, java, php, msql etc

very good
saadi
September 21, 2012
java download

java is good
selvapriya.c
September 25, 2012
java details

hello sir, i need file transfering program using java immediately.can u send?
chandra kanth
September 26, 2012
hi

this website is good for me
violet
December 15, 2012
binary search tree (java)

Hi, please i need some help to write code about binary search tree to do this : print the lowest common ancestor between two nodes V and W, it can be defined as the lowest node T that has V and W as descendants.(public static void printLCA(int x,int y) )
sofian
December 7, 2012
Display percentage value in Pie Chart

I did the coding to create a pie chart file in png format file, the pie chart shows the percentage but in the bottom of the file, I want the percentage to appear in the chart itself, This is the codes I have used, String query = "SELECT name,flag from mawarid"; JDBCPieDataset dataset = new JDBCPieDataset( "jdbc:oracle:thin:@ 127.0.0.1:1521:XE", "oracle.jdbc.OracleDriver", "", ""); dataset.executeQuery(query); JFreeChart chart = ChartFactory.createPieChart("Test", dataset, true, true, false); try{ PiePlot plot = (PiePlot) chart.getPlot(); plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0} {2}")); final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection()); final File file1 = new File("Chart5.png"); ChartUtilities.saveChartAsPNG(file1, chart,600 , 400,info); } catch(Exception e) { }
kamrul
December 8, 2012
class

when give the error following the code: public class AddPersonPanel extends JFrame implements ActionListener{} This error is: package name.class name is not abstract & does not override abstract method actionPerformed
breitling replica
September 28, 2012
http://www.xgpwatches.com/breitling

First of all the idea of the Hoplink, while brilliant, is fundamentally flawed. It fails to take into account of the fact that we as humans, are generally unable to remember large strings of meaningless letters and numbers. If you which to successfully send a link to a prospect, I advise you to use a proper website address and set that address to auto redirect. Not only will it be instantly more memorable but also inspires a far higher degree of confidence in people viewing your link.
rajan
December 11, 2012
java

super
Lovely Lalit
October 4, 2012
Help 4 project

WE NEED UR HELP REGARDING OUR FINAL YERA PROJECT
balogun adewale
October 6, 2012
Training

please i want to confirm if you train students in Java, and other software development programs. I live in Nigeria. Thanks Wale
reza
October 9, 2012
java

I want to write a program in java that convert color image to grayscale,I used "average( RGB )algorithm", but I'm new in java.would you help me?
gopi krishnan
December 12, 2012
java basics

i would like to know java
Dharmvir Kumar
October 13, 2012
Information

when jsp makes servlet then why makes servlet? Plz send me answer on my email id:
sruthi
October 19, 2012
code and definition

1)code for generating selective jamming attach using packets. 2)what is selective jamming and jamming attach using packets.
valavan s
October 23, 2012
How To download full java tutorials

Hai, Am using your website to learn java. but i want to download the full collection of your tutorial.. Is its possible to download your full collection of tutorials.. if possible, how can i download the tutorials?...
Maharshi
October 24, 2012
Core Java

I Like Java
Njush
October 27, 2012
OAENjuYvdDCJLzQPMkq

I'm not as big of fan of Rosetta Stone as many people here. Unforgettable Languages did the trick for me, I saw them on NBC nhlgtiy news one night and got their Italian online course, they use a scientific memory method called Linkword and TRUST me it worked well for this dumb Southerner! Oh and they tout themselves as being the fastest way to learn ANY Language think they are cheaper than Rosetta tooHere is the French Free Demo and Information LinkHere is the Spanish Free Demo and Information LinkGood Luck
mithun
November 5, 2012
java

it is very simple to learn kava
Renu
November 11, 2012
need programming help

hai can any one help me ? task : To define a function which looks like my_func(input_db, output_directory). it has to be robust and: Check if there are any matching NS**** or T**** files existing. Only for those files the function has to be executed! All results should be stored inside a user-definable directory. The function should print out how many data sets were found and how many data sets were processed.
hari
November 14, 2012
java notes with full of example programs

Please send me the notes of java which is having full of programs with the description...thanks in advance
aravind
November 16, 2012
java expert

nice
Bhuvana.k
November 23, 2012
java

i learn quickly and clearly thank for your help
Soumya
November 26, 2012
java

I want to create a java application where computer speaks what i type..how do i start with?
riyaz ali
November 28, 2012
java

i like your programe very much
Jav
November 29, 2012
java

I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running? Instruction: Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates Code: import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
great
November 29, 2012
java

I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running? Instruction: Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates Code: import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
one
November 29, 2012
java

I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running? Instruction: Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates Code: import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
one
November 29, 2012
java

I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running? Instruction: Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates Code: import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
sandeep singh
December 5, 2012
applet

sir, I want to know how to use an applet and what are its various features and advantages
sameer
March 7, 2013
want answer

program to print the 9th number that is both prime and also belongs to the Fibonacci series
Sameer
March 7, 2013
pls answer it

program to print the 9th number that is both prime and also belongs to the Fibonacci series
rathnakar
March 7, 2013
doubt regording thread

why wait(), notify(), notifyall() placed in object class why not in thread class please give proper explanation about this
avdhesh kumar patsariya
April 3, 2013
java

java nots
vani
April 9, 2013
java

what is complete description n meaning and use of abstract method?
sijinmary
April 12, 2013
Thank you

r u give code for following algorithm steps
sadhna
April 13, 2013
using swing in java

how to seprate login registration nd student registration in java using swing
Nagarjuna D
April 17, 2013
core java

i wnt core java
pakeeza
April 24, 2013
plz is program ko mouse events k lea teek krdy

import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseListener; import javax.swing.*; import org.w3c.dom.events.MouseEvent; import java.awt.event.MouseListener; public class mouseEvent implements MouseListener { JLabel l; JTextField tf; public void mouseEvent() { JFrame f=new JFrame(); JPanel p=new JPanel(); l=new JLabel("Name"); tf=new JTextField("Name"); p.add(l); p.add(tf); f.add(p); tf.addMouseListener(new MouseListener(){ public void itemStateChanged(ItemEvent ie){ } public void mouseClicked(MouseEvent arg0) { // TODO Auto-generated method stub } //@Override public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } //@Override public void mouseExited(MouseEvent arg0) { // TODO Auto-generated method stub } //@Override public void mousePressed(MouseEvent arg0) { // TODO Auto-generated method stub } //@Override public void mouseReleased(MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseClicked(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseEntered(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseExited(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mousePressed(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseReleased(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } }); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(400,400); f.setVisible(true); } public static void main(String arg[]) { mouseEvent me=new mouseEvent(); } @Override public void mouseClicked(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseEntered(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseExited(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mousePressed(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseReleased(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } }
Shivashankar
April 24, 2013
Tomcat installation in windows Server

Hi good morning, As I installed Apache Tomcat 5.5 in windows server(Admin). Now the problem is that only one user can run a program on tomcat server at a time, that multi users not able to run a program simultaneously. Please give some solution to above problem ASAP. Thanks you in advance. Kind Regards, Shivashankar
krystoff
May 3, 2013
advance java

1. Implement the Queue class using java collection classes. 2. The following methods must be implemented. public void enqueue(Object o); public Object dequeue(); public Object front(); public boolean isEmpty(); public void clear(); 3. Name you file Queue.java. /* for our latest activity...im having a tough problem
Dernell
June 15, 2013
reaRYusmyJHaQwM

I can't hear anything over the sound of how awesome this artclie is.
Nirav Kamani
June 26, 2013
unable to sign up

sir, help me out i am unable to sign up it sows some error like ajax:500
Rahul
July 3, 2013
advance java

for more awt n swings program
sundar
July 18, 2013
java and all details

pls help me
sundar
July 18, 2013
java and all details

pls help me
sourav sharma
July 24, 2013
core java

package UI; import java.awt.Color; import java.awt.Container; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Paint; import java.awt.PaintContext; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Toolkit; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.awt.image.ColorModel; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JInternalFrame; import javax.swing.JLabel; import javax.swing.JRootPane; public class MainUI extends JDialog implements MouseListener { /** * @param args */ static String[][] templocations=new String[5][]; static int check1,check2,check3,check4,check5; ImageIcon imgicon; Image img; static JButton butt; JLabel addlabel,configure,exit; static Container con; EnlargeUI largeUI; static int count=0; static File savelocations = new File("e:\\Dock\\ObjectDock.doc"); static File savealwaysonTop = new File("e:\\Dock\\alwaysonTop.doc"); AddFrame temp=new AddFrame(this); static String checkTop=""; public MainUI(){ con = getContentPane(); try{ CreateButton button=new CreateButton("","",this); setUndecorated(true); setBounds(0, 0, 500, 65); setLayout(null); try { if(!savelocations.exists()){ savelocations.createNewFile(); // TODO Auto-generated catch block } if(!savealwaysonTop.exists()){ savealwaysonTop.createNewFile(); } } catch (IOException e) { e.printStackTrace(); } try { Scanner scanFile=new Scanner(savelocations); while(scanFile.hasNext()){ String[] splitLocations=scanFile.nextLine().split(";"); AddFrame.GetID.setText(splitLocations[0]); templocations[Integer.parseInt(splitLocations[0])-1]=new String[2]; templocations[Integer.parseInt(splitLocations[0])-1][0]=splitLocations[1]; templocations[Integer.parseInt(splitLocations[0])-1][1]=splitLocations[2]; AddFrame.GetPath.setText(splitLocations[1]); AddFrame.GetTarget.setText(splitLocations[2]); System.out.println(splitLocations[0]); AddFrame.addShortCuts(); } scanFile.close(); Scanner scanFile1=new Scanner(savealwaysonTop); while(scanFile1.hasNext()){ checkTop=scanFile1.nextLine(); } if(checkTop.equalsIgnoreCase("True")){ ConfigureUI.alwaysonTop.setSelected(true); }else{ ConfigureUI.alwaysonTop.setSelected(false); } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } addlabel = new JLabel("ADD"); addlabel.setBounds(400, 5, 50, 25); addlabel.addMouseListener(this); configure = new JLabel("CONFIGURE"); configure.setBounds(400, 20, 70, 25); configure.addMouseListener(this); exit = new JLabel("EXIT"); exit.setBounds(400, 35, 50, 25); exit.addMouseListener(this); con.add(addlabel); con.add(configure); con.add(exit); setVisible(true); }catch(Exception e){ e.printStackTrace(); } } public static void main(String[] args) { // TODO Auto-generated method stub new MainUI(); } public void mouseClicked(MouseEvent arg0) { // TODO Auto-generated method stub if(arg0.getSource()==addlabel){ AddFrame add = new AddFrame(this); add.setVisible(true); }else if(arg0.getSource()==exit){ try { FileWriter writetoFile = new FileWriter(savelocations); for (int i = 0; i < templocations.length; i++) { if(templocations[i]!=null && !templocations[i][0].equals("")){ writetoFile.write((i+1)+";"+templocations[i][0]+";"+templocations[i][1]+"\n"); } } writetoFile.flush(); writetoFile.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.exit(0); }else if(arg0.getSource()==configure){ ConfigureUI confi=new ConfigureUI(this); if(ConfigureUI.Y==1){ confi.setBounds(arg0.getXOnScreen(), arg0.getYOnScreen()-130, 130, 200); }else{ confi.setBounds(arg0.getXOnScreen(), arg0.getYOnScreen(), 130, 200); } confi.setVisible(true); } } public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } public void mouseExited(MouseEvent arg0) { // TODO Auto-generated method stub } public void mousePressed(MouseEvent arg0) { // TODO Auto-generated method stub } public void mouseReleased(MouseEvent arg0) { // TODO Auto-generated method stub // largeUI.setVisible(false); } } //////////pleas correct this program and mail it to me i need it badly/////////
shreeni
July 28, 2013
thanks

It is very useful website. but i need more advanced topics in java til now relesed and their details. it should know about to beginers also
sourav kumar das
September 24, 2013
java

I LIKE IT AND IT IS VERY USEFUL
Howard berklin.B
September 19, 2013
java

java is helpful to how to write the basic programs?
Bijay
September 19, 2013
SSL Session management

Hi, I have been looking for a solution to the problem of SSL Session that is just not going right. I hope you are the right group to reach out, else please help me to reach out to the concerned experts. Scenario: Site is secured (accessed thru https), hence, the connector is defined in server.xml (Tomcat 7.0.32) as: <Connector port="443" SSLEnabled="true" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="D:\Cert\somefile.keystore" keystorePass="******" ciphers="SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_DSS_WITH_AES_128_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,TLS_RSA_WITH_RC4_128_SHA"/> APR Listener is commented out. Index page is a form-based login page, authentication is done by another JSP and certain required user credentials are stored in â??sessionâ?? object as mentioned: session.setAttribute("userid",userid); session.setAttribute("username",username); While logging out, following is the code to invalidate the session: session.removeAttribute("isActive"); session.removeAttribute("userid"); session.removeAttribute("username"); session.invalidate(); response.setHeader( "Pragma", "no-cache" ); response.setHeader( "Cache-Control", "no-cache" ); response.setDateHeader( "Expires", 0 ); response.setHeader("Connection", "close"); response.sendRedirect("index.jsp"); Site works perfectly fine when I access it within the office network (that is, in the same network domain). Problem / issue: When I access the site from outside office (internet), it works fine for the first login, but after logout and when I login as another user, it still shows the previous user credentials. And it becomes even worse when I try login as third user, I get all three users at certain times across pages in my site. As I was reading â??how-toâ?? about SSL in Apache site, I came across that SSL Session need to be handled differently, I tried to invalidate the session as follows, but it throws out error saying â??cannot type cast SSLSupport to SSLSessionManagerâ??: org.apache.tomcat.util.net.SSLSessionManager mgr = (org.apache.tomcat.util.net.SSLSessionManager) request.getAttribute("javax.servlet.request.ssl_session_mgr"); mgr.invalidateSession(); I would be grateful to your help and guidance on resolving this issue. Please do let know if further any information required for clarification. Regards,
manish kumar
December 7, 2013
please give me the fee detail for training in java

looking forward to be a good java programmer
sharanabasappa
January 26, 2014
java

clarification....
m.pavithra
January 28, 2014
web mining in java

I want coding for search engine in java......plz send that to my mail.......
sony
March 21, 2014
eclips always give some problem

whenever I am trying to run exciting code, eclipse stuck...for example it will take more than 30 min to build the project. Please suggest me what to do!!!
mukund rodge
June 7, 2014
java

how to change table heading into marathi language i used marathi font that cant be passible so plzz give me ansert
Madhu sudhan
April 29, 2014
java project

i am trying to make java project from core java by using jframe !!! please help me !
raj
April 18, 2014
java,j2ee

i want to learn java.advanced java
raj
April 18, 2014
java,j2ee

i want to learn java,advanced java
Abhishek hack
April 18, 2011
Java program for static method

public class staticc{ int i; static int j; public static void staticMethod(){ System.out.println("you can access a static method this way"); } public void nonStaticMethod(){ i=100; j=1000; System.out.println("Don't try to access a non static method"); } public static void main(String[] args) { //i=100; j=1000; //nonStaticMethod(); staticMethod(); } }
Archana K Prasad
June 15, 2011
source code for an ieee project

i need java source code for the ieee project "an energy efficient medium access control protocol for wireless sensor networks"
rahul
September 13, 2011
error in program SQLException

pls help me out
Tripti Singh
December 1, 2011
some help needed

i have previously saved riht programs,i have installed the jdk1.5 and set te path again and tried to run those programs by command promt.it was compiled successfully ,but on running it given an exception-exception in thread main-no classDefFounnd! ,plz guide me about it,the attempt of running it on netbeans has also failed.
Remz
December 5, 2011
GUI for car rental system

I'm not to sure on how to create a GUI's in java and i'm wondering if you could help also I tried to create two new classes but I can not get them to run properly no matter what i do here is my code: package carrental; import java.util.*; import java.util.Scanner; class Res { private String name; private int num; // private String make; // private String model; // private String regNo; private Car reservecar; private int deposit; private int rate; Res(String name, int num, String model, String regNo, int days, int cost) { } public String getName() { return name; } public int getNum() { return num; } } class Car { private String make; public String model; private String regNo; private int deposit; private int rate; public Car(String newMake, String newModel, String newRegNo, int newDeposit, int newRate) { make = newMake; model = newModel; regNo = newRegNo; deposit = newDeposit; rate = newRate; } public String getMake() { return make; } public String getModel() { return model; } public String getRegNo() { return regNo; } public int getDeposit() { return deposit; } public int getRate() { return rate; } } public class Main { public static void main(String[] args) { ArrayList<Res> reservelist = new ArrayList<Res>(); ArrayList<Car> carlist = new ArrayList<Car>(); Scanner input = new Scanner(System.in); carlist.add(new Car("Toyota", "Altis", "SJC2456X", 100, 60)); carlist.add(new Car("Toyota", "Vios", "SJG9523B", 100, 50)); carlist.add(new Car("Nissan", "Latio", "SJB7412B", 100, 50)); carlist.add(new Car("Murano", "Nissan", "SJC8761M", 300, 150)); carlist.add(new Car("Honda", "Jazz", "SJB4875N", 100, 60)); carlist.add(new Car("Honda", "Civic", "SJD73269C", 120, 70)); carlist.add(new Car("Honda", "Stream", "SJL5169J", 120, 70)); carlist.add(new Car("Honda", "Odyssey", "SJB3468E", 200, 150)); carlist.add(new Car("Subaru", "WRX", "SJB8234L", 300, 200)); carlist.add(new Car("Subaru", "Imprezza", "SJE8234K", 150, 80)); int num; System.out.println(); do { System.out.println("\t1. Make Reservation. "); System.out.println("\t2. Delete Reservation."); System.out.println("\t3. Review Reservations."); System.out.println("\t4. Quit."); System.out.println(); num = input.nextInt(); switch(num) { case 1: Make(carlist, reservelist); break; case 2: Delete(carlist, reservelist); break; case 3: Review(carlist, reservelist); break; case 4:System.out.println("Thank you for using this program."); break; default: System.out.println(" Please follow directions\n" + " 1 Make Reservation. \n" + " 2 Delete Reservation.\n" + " 3 Review Reservations. \n" ); } }while(num != 4); } public static void Make(ArrayList<Car> carlist, ArrayList<Res> reservelist) { String name = null; int num = 0; Scanner input = new Scanner(System.in); System.out.print("Enter model to rent: "); String model = input.nextLine(); for (Car s : carlist) { if (model.equals(s.getModel())) { System.out.println("Model " + model + " is available"); System.out.print("Enter number of days: "); int days = input.nextInt(); System.out.println("****Details****"); int cost = days * s.getRate() + s.getDeposit(); System.out.println("Deposit DailyRate Duration TotalCost"); System.out.println(s.getDeposit() + " " + s.getRate()+ " " + days + " " + cost); System.out.print("Proceed to rent?( y/n ): "); String dec = input.next(); if (dec.equals("y")) { System.out.println("Enter Customer Name: "); name = input.next(); System.out.println("Enter IC Number: "); num = input.nextInt(); System.out.println("***Receipt****"); System.out.println("Name ICNo Car RegNo Duration TCost"); System.out.println(name + " " + num + " " + model + " " + s.getRegNo() + " " + days + " "+cost); reservelist.add(new Res(name, num, model, s.getRegNo(), days, cost)); System.out.println("Serving Next Customer "); } else if (dec.equals("n")) { System.out.println("Serving Next Customer: "); } } /* if ( carlist.remove(s)) { System.out.println(" Car not available");*/ } } //Delete reservation made public static void Delete(ArrayList<Car> carlist, ArrayList<Res> reservelist) { Scanner input = new Scanner(System.in); System.out.print("Enter name on reservation: "); String name = input.nextLine(); for(Res f : reservelist) { if(name.equals(f.getName())) { System.out.println(f); } } } //review list of reservations public static void Review(ArrayList<Car> carlist, ArrayList<Res> reservelist) { System.out.println(reservelist.size()); } }
Anisa
January 15, 2012
i need help in this exersize

Write a program that creates a text file that contains a power of two table in HTML format. The file could be called "twoPowerTable.html". When it is viewed with a browser you will see something like: Power of 2 Value 0 1 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256 9 512 10 1024 The file should start with something like: <html><head> <title>Powers of Two</title> </head> <body> <table border cellpadding=5> <tr><th>Power of 2</th><th>Value</th></tr> And end with: </table> </body></html> Each line of the table looks like: <tr><td>0</td><td>1</td></tr>
kovilmani
February 8, 2012
Database

code
Richa Seth
July 2, 2013
Threads

I want that all threads will notify each other and kill the other threads once the thread search the path. package richa; import java.io.File; class MyThread extends Thread { static int spc_count = -1; public MyThread(String s) { super(s); } public void run() { System.out.println("Run: " + getName()); File file = new File(this.getName()); System.out.println("Directory:" + file); Process(file); } public void Process(File aFile) { spc_count++; String spcs = ""; for (int i = 0; i < spc_count; i++) spcs += " "; if (aFile.isDirectory() && aFile.getName().equals("abcdefgh")) { System.out.println(spcs + "[REQUIRED DIREECTORY] " + aFile.getAbsolutePath()); } else if (aFile.isDirectory()) { // System.out.println(spcs + "[DIR] " + aFile.getName()); File[] listOfFiles = aFile.listFiles(); if (listOfFiles != null) { for (int i = 0; i < listOfFiles.length; i++) { Process(listOfFiles[i]); } } else { // System.out.println(spcs + " [ACCESS DENIED]"); } } spc_count--; } } class TestThread { public static void main(String arg[]) { File[] roots = File.listRoots(); System.out.println("Total Paths:" + roots.length); for (int i = 0; i < roots.length; i++) { MyThread temp = new MyThread("" + roots[i]); System.out.println(roots[i]); System.out.println("Started Thread:" + i); temp.start(); // while(true){ // // if(testFound==true){ // // for(Thread thread : threads) // // { // // thread.interrupt(); // // //thread.stop(); // // } // // break;//breaks from while loop // // } // // else{ // // try { // // t.sleep(1); // // } catch (InterruptedException e) { // // // TODO Auto-generated catch block // // e.printStackTrace(); // // } // // } // // } } } }
DMCA.com