JAVA send http Get Post request with basic authentication

In the video I have shown how you can send HTTP get request and Post request with a real time example. The server is giving response in JSON format. The JSON response is parsed with java to get the parameters output. This source code is demonstrated with reddit login API documents. You will have to …

Continue reading

Simple JAVA program to download Youtube vidoes

Using the below simple java program you can download Youtube videos. We have to download an executable exe file from below link or their website. Download youtube-dl here. youtube-dl.rar Download this exe file and keep in the folder where you need to have your downloaded videos. 1. Project Structure in Eclipse IDE. 2. my_main.java package …

Continue reading

Java JSP Javascript – Submit form without reloading page

In this video I have shown how to submit a form from a JSP page without refreshing the page. This is purely on Javascript and will work on any HTML supported platforms like PHP, .Net etc. This project is demonstrated in Eclipse IDE with Tomcat server. 1. Project Structure in Eclipse IDE. 2. index.jsp holds …

Continue reading

JAVA- Integrate login with Facebook using restfb API

In this video I have shown how you can integrate Login with facebook in web projects using restfb API. All the documentations are available in restfb.com documentation section. Here is the steps what you have to follow. 1. Login to facebook developers site and get an APP id by creating a facebook APP. 2. Grant …

Continue reading

How to generate QR code with Image using JAVA

In this video I have shown how you can create a QR Code with logo in side the QR. We are using 2 jar files which should be added in ClassPath to create the QR file. The jars are, 1 . javase-2.2.jar 2 . zxing-core-2.0.jar QR_Generate.java package com.chillyfacts.com; import java.awt.AlphaComposite; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import …

Continue reading

Java Switch Statement source code

Java Switch statement executes if any of the cases in the switch is matched. Just like if-else-if ladder statement. Switch statements can be used only to String,int and enum parameters by default. 1.Java Switch with Integer Argument example. Java_Switch.java package com.chillyfacts.com; public class Java_Switch { public static void main(String[] args) { int i = 100; …

Continue reading

Create Barcode in JSP page

How to Create and Shown bar code in JSP Page. I have shown this using Eclipse IDE. 1. Project Structure 2. The jar used in the project are, 1. barcode4j.jar 2. itextpdf-5.1.0.jar 3. Mysql connector jar 3. Create Barcode in Static way using below Servlet Create_Bar_Code.java package com.chillyfacts.com; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; import …

Continue reading

JAVA Get current time from different time zones as String

How to get Current Time from Different time zones JavaTimeZoneTest.java package com.chillyfacts.com; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class JavaTimeZoneTest { public static void main(String[] args) { TimeZone timeZone = TimeZone.getTimeZone(“GMT”); SimpleDateFormat date_format=new SimpleDateFormat(“dd-MM-yyyy EEEE hh:mm:ss a”); date_format.setTimeZone(timeZone); Date date=new Date(); String current_date_time=date_format.format(date); System.out.println(“GMT-“+current_date_time); timeZone = TimeZone.getTimeZone(“Asia/Kolkata”); date_format.setTimeZone(timeZone); current_date_time=date_format.format(date); System.out.println(“Asia/Kolkata-“+current_date_time); timeZone = TimeZone.getTimeZone(“Australia/Perth”); date_format.setTimeZone(timeZone); …

Continue reading

java if statement source code-Simple Java Programs

In this video I have shown the four common different if statements with example source code. The four if statements are, 1. if statement 2. if-else statement 3. if-else-if ladder 4 .nested if statement Project Structure If_Statement.java package com.chillyfacts.com; public class If_Statement { public static void main(String[] args) { int i=15; System.out.println(i>10); if(i>10){ System.out.println(“i is …

Continue reading