Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to resize an array

    	int length = Array.getLength(a);
        Class componentType = a.getClass().getComponentType();
        Object newArray = Array.newInstance(componentType, newLength);

Java: safe collection operation

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class CollectionSafeIteration

Java: How to compare File Dates

import java.io.File;
public class File_Date
{
  private static String compare_File(String fichier1, String fichier2)
  {
  	String result="";
  	long

Java: Moving an Image using AffineTransform class

/*
License for sako adams adamafitini@gmail.com
You can use the examples and the source code any way you want, but
please include a reference to wher

Java: how to access to a URL via proxy

import java.io.DataInputStream;
import java.io.FileOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Proper

Java: How to use JColorChooser

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class JColorChooserExample extends JFrame
{
    JLabel myLabel;
    Color cur

Java: How to store BLOB data into database

import java.io.File;
import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
pu

JavaMail: How to use the FileDataSource class to send a file via email

import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class EmailsAttachFile
{

Java: Save text file into a database

import java.io.File;
import java.io.FileReader;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public

Java: How to use CallableStatement to call a stored procedure

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
public class CallableStmts
{
  public static void main(

Java: Example of an underline and strikethrough text

  import java.awt.*;
  import java.awt.font.TextAttribute;
  import java.text.*;
  import javax.swing.*;
  public class AttributText
		{
		 public st

Java: How to create forms by using swing components

import javax.swing.*;
import java.awt.*;
public class JavaForms
 {
  public static void main(String[] args) {
    JTextField txtName = new JTextField

Java: How to use a generic Iterator on the collections

import java.util.ArrayList;
import java.util.Iterator;
class ArrayL_IterGern
 {
  public static void main(String args[])
  {
    ArrayList array_L =

Java: access password protected url using java.net.Authenticator class

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.Authenticator;
import java.net.InetAddress;
import java.net.Password

Java: How to determining If a Year Is a Leap Year

import java.util.GregorianCalendar;
public class LeapYear
{
  public static void main(String[] argv) throws Exception
  {
    GregorianCalendar