Sending Mail From Java

Sending Mail From Java: You can send mails from java, here using gmail smtp sample working code given. Required Jar: javax.mail Java Program: package in.javadomain; import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SendMail { public static void main(String[] args) { final String fromEmailId = "gmail-username"; final String fromEmailPwd =

183 total views, no views today

» Read more

FileSearch in Java with User Interface

FileSearch in Java with User Interface: This Program will help you to search a particular file in a particular drive (c,d,e or f etc). Java Program: import java.io.File; import java.util.ArrayList; import java.util.List; import javax.swing.JOptionPane; public class FileSearch extends javax.swing.JFrame { /** * Creates new form SimpleUI */ List myArrayList = new ArrayList(); public FileSearch() { initComponents(); } private void initComponents()

192 total views, 3 views today

» Read more

Convert Pdf to Word in Java Example

Convert Pdf to Word in Java: Required Jars: 1. itextpdf-5.4.4 2. xmlbeans-xpath-2.3.0 3. xmlbeans-2.6.0 4. poi-3.9 5. dom4j-1.6.1 6. poi-ooxml-schemas-3.7 7. poi-ooxml-3.7 Java Program: package in.javadomain; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.xwpf.usermodel.BreakType; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFParagraph; import org.apache.poi.xwpf.usermodel.XWPFRun; import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.parser.PdfReaderContentParser; import com.itextpdf.text.pdf.parser.SimpleTextExtractionStrategy; import com.itextpdf.text.pdf.parser.TextExtractionStrategy; public class ConvertPdf2Word { public static void main(String[] args) throws IOException { System.out.println("Document converted

2,821 total views, 25 views today

» Read more

Converting Word to Pdf in Java Example

I am updating this post to provide, maven project with all the required dependencies Resolved log4j warning at the top of the converted pdf.   Converting Word to Pdf in Java Example:   pom.xml: To keep the post clean I kept only the required portion, please download the zip file for complete files. <dependency> <dependency> <groupId>org.docx4j</groupId> <artifactId>docx4j-ImportXHTML</artifactId> <version>3.0.0</version> <exclusions> <exclusion>

3,359 total views, 32 views today

» Read more

Jsoup Tutorials

1. Introduction 2. Input    2.a From String    2.b From URL    2.c From File 3. Parsing Data    3.1 parsing element by id    3.2 parsing element by tag    3.3 parsing element by class    3.4 parsing element by attributes    3.5 parsing sibling elements    3.6 parsing parent and children elements 4. Selectors    4.1 find elements

261 total views, 4 views today

» Read more
1 2