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

Create Document file dynamically using java

In this project we are trying to create a Microsoft Word file using Apache POI api with JAVA. 1. Project Structure 2. Jars used in the project are, 1. poi-3.17.jar 2. poi-ooxml-3.17.jar 3. poi-ooxml-schemas-3.17.jar 4. xmlbeans-2.6.0.jar 5. Mysql connector jar 3. Generate_Document.java package com.chillyfacts.com; import java.io.File; import java.io.FileOutputStream; import org.apache.poi.xwpf.usermodel.VerticalAlign; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFParagraph; 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

JAVA JSP file upload example source code

In this video I have shown how you can create a JSP file upload. This project is shown in Eclipse IDE. 1. Project Structure 2. The jar file used in the project are, 1.org.apache.commons.io.jar 2.commons-fileupload-1.3.1.jar 3. The servlet will upload the image to d:\uploaded_files folder FileUploadHandler.java package com.chilyfacts.com; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import …

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 SimpleDateFormat different date formats

How to get the current date and time as String value. SimpleDateFormat get date and time in different formats. Read the date as String value. SimpleDateFormats.java package com.chillyfacts.com; import java.text.SimpleDateFormat; import java.util.Date; public class SimpleDateFormats { public static void main(String[] args) { SimpleDateFormat date_format=new SimpleDateFormat(“dd-MM-yyyy EEEE hh:mm:ss a”); Date date=new Date(); String current_date_time=date_format.format(date); System.out.println(current_date_time); } …

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

Java Simple Hello World Program in Eclipse

Hello World program in Eclipse Example. Follow the below steps, Go to File > New > Java project Project Structure HelloWorld.java package com.chillyfacts.com; public class HelloWorld { public static void main(String[] args){ System.out.print(“Hello World!!”); } } Out put in console Hello World!! Download the project here, HelloWorld.rar

Continue reading

How to Generate or Read QR code Dynamically using JAVA

This project is developer in zxing API. Project Structure in Eclipse, The 3 jars used are, 1. zxing-core-2.0.jar 2. zxing-1.7-javase.jar 3. MySQL Connector The below code will generate the QR code with data chillyfacts.com Create_QR.java package com.chillyfacts.com; import java.io.File; import java.util.HashMap; import java.util.Map; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.MultiFormatWriter; import com.google.zxing.client.j2se.MatrixToImageWriter; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; …

Continue reading