Java Code Examples, Tips and Articles

Welcome to Javadb.com


Javadb.com provides source code examples in the Java language as well as other Java specific resources. Feel free to browse through the content or to search for a code example.
Arrays
java source code example Sorting an Array in Descending (Reverse) Order
java source code example Convert an Array to a List
java source code example Extend the size of an array
java source code example How to copy an array
java source code example Using the Comparable interface to compare and sort objects
View more...

Collections
java source code example Convert LinkedList to Array
java source code example Convert a List (ArrayList) to an Array
java source code example Using a Set (or HashSet)
java source code example Using a Queue (or LinkedList)
java source code example Using a Stack
View more...

Compression
java source code example Extract contents of a zip file
java source code example How to list the contents of a zip file
java source code example How to create a zip file

Database
java source code example Connect to database and call stored procedure
java source code example Using a database transaction with JDBC
java source code example Connecting to a Database - Step by Step
java source code example Connect to a database and read from table

Datatype conversions
java source code example Convert byte[ ] array to String
java source code example Convert String to byte array
java source code example Convert String to Boolean
java source code example Convert Boolean to String
java source code example Convert byte to String
View more...

File I/O
java source code example Using BufferedReader to read input number from user
java source code example Read Input From User and Write to File
java source code example How to rename a file (change file name)
java source code example Remove a line from a text file
java source code example Loading configuration parameters from textfile into a program
View more...

Graphics Java 2D
java source code example Drawing a Ractangle with rounded corners using Java 2D Graphics API
java source code example Drawing a Ractangle using Java 2D Graphics API
java source code example Drawing a Line using Java 2D Graphics API
java source code example Drawing a String using Java 2D Graphics API

Java Language Fundamentals
java source code example Get Name of User Currently Logged In to the Computer
java source code example Convert a String to Date
java source code example Convert Characters to Lower Case
java source code example Convert Characters to Upper Case
java source code example Replace Characters in a String
View more...

Networking
java source code example Sending a POST Request with Parameters From a Java Class
java source code example Downloading a web page using URL and URLConnection classes
java source code example Perform NSLookup with the InetAddress class

Reflection
java source code example Instantiate unknown class at runtime and call the object's methods
java source code example List methods of a class using Reflection
java source code example Invoke methods of an object using reflection

Servlets
java source code example Redirect Servlet Call to Another URL
java source code example Forward Call from a Servlet
java source code example Get Users IP Address
java source code example Get and Set Session Variables in a Servlet
java source code example Get Request Parameters in a Servlet

Small programs
java source code example How to find and calculate prime numbers

Swing
java source code example Show a message dialog with JOptionPane
java source code example Set Look and Feel for a Swing application
java source code example JLabel with more than one row

Threads
java source code example Setting thread priorities
java source code example How to create a thread

Utility Classes
java source code example Create a Date object using the Calendar class
java source code example Get Today's Date
java source code example Increment and Decrement a Date Using the Calendar Class
java source code example Get current date and time with the SimpleDateFormat class
java source code example Getting Currency Symbols
View more...

Web Services
java source code example Using a Message Handler to alter the SOAP Header in a Web Service Client
java source code example Create a Web Service Client with JAX-WS
java source code example Create a simple Web Service


Tutorials
java source code example Java Language Tutorial


Bookmark: Social bookmarks del.icio.us digg Furl YahooMyWeb blinkbits BlinkList blogmarks co.mments connoteas De.lirio.us Fark feedmelinks LinkaGoGo Ma.gnolia NewsVine Netvouz RawSugar Reddit scuttle Shadows Simpy Smarking Spurl TailRank Wists segnalo




Need help with your Java code? It's secure and confidential.
This is how it works:
Send a detailed description of what you need help with, the more details the better. Also provide a deadline for when it has to be finished. More time means better chance of putting your request into the schedule.

If the request is serious you will shortly receive an email with the price, to which you have to respond if you accept.

Once you have accepted, the work will begin on developing your code by an experienced Java developer. When the code is finished a link to a secure payment will be sent to you.

The source code is then sent to you once the payment is completed.


Write your detailed request here:

E-mail address:





What's on in the Java world?

  • Editor's Daily Blog   2009-07-02 05:45
    Have you ever thought about starting a Java User Group? Matt Stine spoke with me at JavaOne about his experiences with starting and growing the Memphis/Mid-South Java User Group in a java.net Community Corner podcast... Also:
    Java Today: The ATM Object-Oriented Design and Implementation Case Study; JUG Leadership: Lessons Learned; and Hudson Growth - Plugins, Jobs, Eclipse.
    Weblogs: What is new with Pivot?; ; and Attaching Security Policies to Individual Operations.
    Forums: SUNONE APP Server 8.2 and JMX MBeanServer; NEED HELP!! how to Display IMEI number on Java ME emulator device; and Invalid user or password after undeploy.
    Featured Articles: Grails and Continuous Integration: An Essential Combo; Exposing Domain Models through the RESTful Service Interface, Part 1.
    Featured Podcast: Java Mobility Podcast 81: JTDF.
  • PUJ, a JUG Contest: Community Corner Podcast   2009-07-01 07:55
    Felipe Gaucho talked about the Premio Universitaro Java (PUJ) competition with Jim Wright in a 16-minute java.net Community Corner podcast... Also:
    Java Today: PUJ, a Jug Contest, JavaOne 2009 Podcast; What's the Right GlassFish Release For You?; and Conference Roundup: Jazoon 2009.
    Weblogs: My JavaOne 2009 presentations online; FISL 2009 Wrapup - 3 talks, 1 talk show, 14 blogs, 10 videos, 275 pics, 2 GlassFish production stories; and Fixing bugs in RHN v1.x.
    Forums: Support For BlackBerry; Warning about accessing Swing or AWT objects from inside a commit; and Glassfish+jersey+json+natural convention and new jaxb.
    Featured Articles: Grails and Continuous Integration: An Essential Combo; Exposing Domain Models through the RESTful Service Interface, Part 1.
    Featured Podcast: Java Mobility Podcast 81: JTDF.
  • Java Tools Community Corner Podcast Features Duke's Choice Award Winners   2009-06-30 05:53
    When Java Tools Community Leaders Toni Epple and Fabiane Nardon invited the SQE (Software Quality Environment) Project team to participate in the Java Tools SQE Roundtable podcast at this year's JavaOne, they weren't planning on the Duke's Choice Awards being among the topics of conversation... Also:
    Java Today: NetBeans IDE 6.7 Now Available for Download!; Java Tools SQE Roundtable, JavaOne 2009; and Java ME Defragmentation.
    Weblogs: NetBeans 6.7 is here. Grab your copy and explore tens of new features; supercrud.com in Brazil picked GlassFish over JBoss - Find out why!; and A First Look at NetBeans 6.7.
    Forums: glassfish v3 sometime halt; Track client session in a WS implemeted as an EJB; and Pick Midlet not working in Resource Editor.
    Featured Articles: Grails and Continuous Integration: An Essential Combo; Exposing Domain Models through the RESTful Service Interface, Part 1.
    Featured Podcast: Java Mobility Podcast 81: JTDF.
  • Community Corner 2009 Podcasts Being Published   2009-06-29 07:16
    The first of many Community Corner podcasts that were recorded at JavaOne 2009 has been released: the Java Tools SQE Roundtable... Also:
    Java Today: JavaTools Community Newsletter - Issue 198; java.net is sloooooow; and FISL 2009 Report.
    Weblogs: Trident animation library - overview and roadmap; Upgrading to Eclipse Galileo; and Running the OpenSolaris OS From a Browser.
    Forums: Specifiying Address / Interface for cluster node communication; Create a Java User Group; and How to force behavior updates in off-screen mode?.
    Featured Articles: Grails and Continuous Integration: An Essential Combo; Exposing Domain Models through the RESTful Service Interface, Part 1.
    Featured Podcast: Java Mobility Podcast 81: JTDF.
  • Poll Result: More Java.net Project and Community Focus Desired   2009-06-26 08:22
    A significant majority of participants in the latest java.net poll would like to see increased project and community content on java.net... Also:
    Java Today: Javali 2009 Trip Report; Notes from Wednesday at Jazoon; and Notes from Thursday at Jazoon.
    Weblogs: Running GlassFish V3 with Apache httpd; Win your Copy of Wiley's OpenSolaris Bible book; and Growth of Hudson plugin ecosystem.
    Forums: Trouble adding LWUIT.jar to Eclipse MTJ MIDlet Project; JRoR WAR deployment to GF3 fails; and Exception Interceptor.
    Featured Articles: Exposing Domain Models through the RESTful Service Interface, Part 1; Hacking JavaFX Binding.
    Featured Podcast: Java Mobility Podcast 81: JTDF.
  • Jazoon09: Alois Reitbauer on Scalability   2009-06-25 06:00
    Harold Carr attended Alois Reitbauer's session "Why applications do not scale" at Jazoon09... Also:
    Java Today: Notes from Tuesday morning Jazoon; Javali 2009 Trip Report; and Wine delivered at OSGi DevCon.
    Weblogs: Help me shape future of Java libraries; Installing Sonar on a linux build server; and The Ultimate Craftsman.
    Forums: how to go to next lines in a label; How to build JTDS JDBC driver; and Deriving components breaks ActionListener?.
    Featured Articles: Exposing Domain Models through the RESTful Service Interface, Part 1; Hacking JavaFX Binding.
    Featured Podcast: Java Mobility Podcast 81: JTDF.
  • Jazoon09   2009-06-24 06:44
    Jazoon09, the international conference on Java technology, is completing its second full day of sessions... Also:
    Java Today: Speaking on Metro Security at Jazoon; Pocket guide to Jazoon 2009; and Roger speaking at Javali.
    Weblogs: FX Mobilization; Learning JSF 2; and New JCP.org debuts, JSF2 DataSheet Published, Try the JavaEE 6 SDK.
    Forums: Calling C# dll via VC++ from Java; Overlarge synchronized blocks in Display causing deadlocks?; and Get individual monitoring value.
    Featured Articles: Exposing Domain Models through the RESTful Service Interface, Part 1; Hacking JavaFX Binding.
    Featured Podcast: Java Mobility Podcast 81: JTDF.
  • 2009 JCP Program Awards and Videos   2009-06-23 05:48
    Felipe Gaucho attended the 2009 JCP Program Awards ceremony, and provides some videos of the event... Also:
    Java Today: JCP 2009 Annual Awards Winners (with videos); JSR 255 (JMX API 2.0) is postponed; and University of Utah - Ported 60 applications from Weblogic to GlassFish.
    Weblogs: JSF 2.0 Refcard available; JavaFX Script tip: The Single Assignment per Method rule (and more); and Our second hybrid application - EJB as OSGi Service.
    Forums: Help required; Re: getting at the SOAPHeader directly from inside @WebMethod; and how to control the square size of a checkbox?.
    Featured Articles: Hacking JavaFX Binding; Zero and Shark: a Zero-Assembly Port of OpenJDK.
    Featured Podcast: Java Mobility Podcast 81: JTDF.
  • Inside the Java Store: Q & A   2009-06-22 07:53
    Josh Marinacci has been secretly working on a project that became one of the big announcements at this year's JavaOne: the Java Store... Also:
    Java Today: The Java Store, a Q&A; OpenDS 2.0.0 Release Candidate 2 Ships; and Atmosphere 0.2 GA now available.
    Weblogs: JWebPane BOF screenshots at JavaOne (2009); First enhancements on BetterBeansBinding; and Learning JavaFX?.
    Forums: When do I need Multicast, HADB, in-memory-replication on a cluster?; EJB web service from WSDL doesn't work with external XSD; and Re: Delivery of JMS message in case of distributed transaction.
    Featured Articles: Hacking JavaFX Binding; Zero and Shark: a Zero-Assembly Port of OpenJDK.
    Featured Podcast: Java Mobility Podcast 81: JTDF.
  • Poll: Majority Believes There Will Be a JavaOne Conference in 2010   2009-06-19 07:33
    A majority (57%) of respondants to this past week's java.net poll expect there to be a JavaOne conference in 2010... Also:
    Java Today: Project Coin Announces Second Candidate List, Redesigned Java Community Process Website, and Trending Analysis With Maven Dashboard .
    Weblogs: Jazoon!, Shame on us all, and Jazoon Bloggers Squad.
    Forums: Re: [webtier] JSF - javax.faces.STATE_SAVING_METHOD, Corrupted XML (SOAP responses) under load, and Handling empty HTTP POST in JAX-WS.
    Featured Articles: Hacking JavaFX Binding; Zero and Shark: a Zero-Assembly Port of OpenJDK.
    Featured Podcast: Java Mobility Podcast 81: JTDF.