How to open a program like notepad, pdf file using Java?

Java program to open any program or file Example(s)  1. Open notepad program file using java. 2. Open a pdf file using java. This example will open a notepad for you. 1. Simple.java

This is a simple example to open a pdf file using java. To do so you just need to write some Read more about How to open a program like notepad, pdf file using Java?[…]

How to Compress a File(.txt) and Read From the Compressed File(.zip) in Java?

The following example demonstrates the use of Java Programming Language in compressing files into .zip formats and reading from a zipped file (getting it back). While running the program please provide the name of the file which is to be zipped as a runtime argument(0) and the new name of the zipped file at argument(1). Read more about How to Compress a File(.txt) and Read From the Compressed File(.zip) in Java?[…]

How to use Encryption – Decryption in Java?

The Java platform strongly emphasizes security, including language safety, cryptography, public key infrastructure, authentication, secure communication, and access control. The following example demonstrates the use of Java Programming language to implement encryption and decryption functionality. e.g.: Java’s support for cryptography and security.

OUTPUT:

Get the number of lines and characters in a file using Java

This example demonstrates one of the ways to find the number of lines and characters in a file using Java Programming Language Here is the block of code that will make the task easy for you

  The file named “file.txt” here in this example is located inside the folder named codedbug on drive Read more about Get the number of lines and characters in a file using Java[…]

How to perform printing task using java swing?

How to perform the print task using Swing? This is a simple program to show how you can use Java Coding to give the print option to your Java Swing projects or applications. Program: TestPrinterJob.java Summary: Demonstrate use of Print using PrinterJob. import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JTextArea; import java.awt.BorderLayout; import java.awt.Color; import Read more about How to perform printing task using java swing?[…]

J2EE – Servlet – Short Description

1.       J2EE is a technology to develop distributed, scalable, enterprise applications. 2.       J2EE is a technology that comprises or composed of many technologies a.       Servlet b.      EJB c.       JSP d.      JDBC e.      JMS f.        JCA g.       JNDI 3.       J2EE is the number 1 technology in server side. 4.       J2EE is a component based architecture. 5.       Read more about J2EE – Servlet – Short Description[…]

Click Programmatically

Q: How to click programmatically? Suppose there is a need(like system goes to sleep if it is idle after a particular interval of time) and you want to keep the system alive. One of the ways out is automatic clicking of a mouse. Go through the following program Enjoy — DoNotSleep.java —

OUTPUT:

Read Line by Line from a file and insert into database table likewise

How to read line by line from a file and insert likewise in to database table can be achieved with the help of following block of code. 1. ReadLineInsertLine.javapackage readlineinsertline; import db.Insert;import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;import java.io.FileReader;import java.io.IOException;import java.io.InputStreamReader;import java.io.LineNumberReader;import java.text.DateFormat;import java.text.SimpleDateFormat;import java.util.Date; /** * * @author Sudhanshu */public class ReadLineInsertLine {     /**     * @param args the command Read more about Read Line by Line from a file and insert into database table likewise[…]

Read a complete file and Insert it into database using Java

Hello Friends, The example below demonstrates How you can read the whole file contents and write at once in database. This program will read all the contents in form of bytes and will insert it into database table before passing it to the insert method it has been converted into string. This program is useful Read more about Read a complete file and Insert it into database using Java[…]

How to read and copy contents from one file into another (Java)

This programs copies all contents of file myfile.txt into a new file file.txt. import java.io.DataOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; /** * E:\core\io\NB\file.txt * @author Sudhanshu */ public class ReadWrite { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { FileOutputStream fos; DataOutputStream dos; FileInputStream fis Read more about How to read and copy contents from one file into another (Java)[…]

Contact Us
close slider
Contact Us

How can we help you with?