Source Code

File Dialog Box Program
File Dialog Box ProgramHere is example Java code showing how to make a file dialog box. This program uses the JFileChooser to make an open file dialog box and a save file dialog box.When run this program shows a frame with a text area, an open dialog button and a save dialog button. The text aream w…[ More ]
Upload and Save Image in Swings
Upload and Save Image in Swingsimport java.awt.BorderLayout;import java.awt.Container;import java.awt.Graphics;import java.awt.Image;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.image.BufferedImage;import java.io.BufferedReader;import java.io.File;import jav…[ More ]
Wrap file upload requests
Wrap file upload requestsSupport for file uploads was added relatively late to the Servlet Specification, starting with version 3.0. Earlier versions of the spec have poor support for file uploads. The following applies to such earlier versions.If a form contains one or morefile uploadcontrols, the …[ More ]
Java POST data request returns HTTP response code 500
Java POST data request returns HTTP response code 500package net.discfiresoftworks.chat;import java.awt.Color;import java.awt.FlowLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.io.BufferedReader;import java.io.DataOutputStream;import java.io.InputStreamRead…[ More ]
MultipartFileUploadApp
MultipartFileUploadApp * $HeadURL$ * $Revision$ * $Date$ * ==================================================================== * *  Licensed to the Apache Software Foundation (ASF) under one or more *  contributor license agreements.  See the NOTICE file distributed with *  this work for additional…[ More ]
Upload file using Java Swing and PHP
Java Swing File upload with Php on the serverYou can upload a file through your swing application to a web server supporting PHP (Apache).You can use jakarta HttpClient libraryFollowing is the code at the client side import java.io.File;import org.apache.http.HttpEntity;import org.apache.http.HttpRe…[ More ]
Upload files with java
Upload files with javaYou'd normally use java.net.URLConnection to fire HTTP requests. You'd also normally use multipart/form-data encoding for mixed POST content (binary and character data). Click the link, it contains information and an example how to compose a multipart/form-data request bo…[ More ]
Validation using the builder pattern
You can use it like this:PersonValidator personValidator = new Validator().code("11111").sequence(2).validate();personValidator.throwFirstExceptionIfAny();or some steps at a time:Validator validator = new Validator();validator.code("11111");// do some other stuffvalidator.sequence(2);PersonValidato…[ More ]
JTree node mouse click event : JTree Node Swing Java Tutorial
JTree node mouse click event : JTree Node « Swing « Java Tutorialimport java.awt.BorderLayout;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;import javax.swing.JFrame;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.JTextField;import javax.swing.JTre…[ More ]
How to check if two images are similar or not using openCV in java?
have to check if two images are similar or not in java using OpenCV, I am using OpenCV for that and using ORBHere is my main classSystem.out.println("Welcome to OpenCV "+Core.VERSION);System.loadLibrary(Core.NATIVE_LIBRARY_NAME);());System.out.println(System.getProperty("user.dir"));File f1…[ More ]
Implement image comparison using openCV in android [closed]
Implement image comparison using openCV in android [closed]privateBaseLoaderCallback  mLoaderCallback =newBaseLoaderCallback(this)I have added these codeFeatureDetector detector =FeatureDetector.create(FeatureDetector.ORB);
  DescriptorExtractor descriptor =DescriptorExtractor.…[ More ]
Compare the similarity of two images with opencv?
Compare the similarity of two images with opencv?It is not so easy task, and it is impossible to do with one if. What I recommend is to match image's interest points. Basically you can use opencv library to identify interest points on images and perform the match of them. If the percentage of …[ More ]
Applet code for java
Applet code  for javaimport java.awt.Color;/** * Class that references a pixel in a picture. A pixel has an x and y * location in a picture.  A pixel knows how to get and set the red,  * green, blue, and alpha values in the picture.  A pixel also knows * how to get and set the color using a Color ob…[ More ]
Using Dropbox Java API for uploading files to dropbox
Using Dropbox Java API for uploading files to dropboxJava Classpackage com.dropbox.client; import com.dropbox.client.DropboxAPI.Config; import java.io.File; import java.net.URL; import java.util.HashMap; import java.util.Map; /** * * @author Charan */ public class DBmain { …[ More ]
Upload files to FTP Server in Java - Using Commons Net API
Upload files to FTP Server in Java - Using Commons Net API In today's discussion we will came across 'How to upload files to FTP server in Java'. We are using 'apache commons-net' API that holds all necessary classes to deal with FTP operations like, create connection , get list of all files on …[ More ]
Java FTP Upload Example using Apache Commons Net API
Java FTP Upload Example using Apache Commons Net APIpackage com.journaldev.inheritance; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import org.apache.commons.net.PrintCommandListener; import org.apache.commo…[ More ]
Get list of files from FTP Server in Java - Using Commons Net API
Get list of files from FTP Server in Java - Using Commons Net API .In today's discussion we will came across 'How to get list of files from FTP server in Java'. We are using 'apache commons-net' API that holds all necessary classes to deal with FTP operations like, create connection , get list o…[ More ]
Download files from FTP Server in Java - Using Commons Net API
Download files from FTP Server in Java - Using Commons Net API In today's discussion we will came across 'How to Download files from FTP Server in Java'. We are using 'apache commons-net' API that holds all necessary classes to deal with FTP operations like, create connection , get list of all f…[ More ]
Delete files from FTP Server in Java - Using Commons Net API
Delete files from FTP Server in Java - Using Commons Net API In today's discussion we will came across 'How to Delete files from FTP Server in Java'. We are using 'apache commons-net' API that holds all necessary classes to deal with FTP operations like, create connection , get list of all fil…[ More ]
Create connection with FTP server in Java - Using Commons Net API
Create connection with FTP server in Java - Using Commons Net APIIn today's discussion we will came across 'How to establish connection with FTP server in Java'. We are using 'apache commons-net' API that holds all necessary classes to deal with FTP operations like, create connection , get list …[ More ]