Before reading this post kindly go from part 1 of this post to understand lambda expression. https://jkoder.com/understanding-java-8-lambda-expression-functional-programming-in-java-8-part-1/ Here we will see practical difference between JAVA 7 and JAVA 8. We will create a list of Person objects and we will do below 3 things on it first by using JAVA 7 way then by JAVA 8 way. Sort list by ... Read More »
Java Core
Sample usage of Lambda Expression with Runnable interface- Functional Programming in JAVA 8- Part 3
Sample usage of Lambda Expression with Runnable interface- Functional Programming in JAVA 8- Part 3 Before reading this post kindly visit from part 1 of this post to understand lambda expression. https://jkoder.com/understanding-java-8-lambda-expression-functional-programming-in-java-8-part-1/ There is no Function Type in JAVA for lambda expression types, JAVA designers reused the concept of Interface Type that is already available in JAVA. There may be ... Read More »
JAVA 8 Lambda Expression as Interface Type- Functional Programming in JAVA 8- Part 2
JAVA 8 Lambda Expression as Interface Type- Functional Programming in JAVA 8- Part 2 Before reading this post kindly go through part 1 of this post to understand lambda expression. https://jkoder.com/understanding-java-8-lambda-expression-functional-programming-in-java-8-part-1/ It’s time to uncover the type of lambda expression and the execution of lambda expression. Here’s the code that we have been looking in the part-1 post. Output:- Hello ... Read More »
Understanding JAVA 8 Lambda Expression- Functional Programming in JAVA 8- Part 1
Understanding JAVA 8 Lambdas- Functional Programming in JAVA 8- Part 1 Why Lambdas?….Lambdas is a new programming construct which lets you build JAVA applications in a completely different paradigm. So, what are the advantages that lambdas bring to the table:- Lambdas enables Functional programming in JAVA, it’s actually a paradigm shift from conventional Object Oriented programming. Readable and concise code ... Read More »
Generate Windows EXE installer setup/EXE executable file from executable JAR file using javapackager of JAVA8 JDK
Generate Windows EXE installer setup/EXE executable file from executable JAR file using javapackager of JAVA8 JDK For all those who are dealing with executable JARs of technologies like SWING or any other standalone applications. Yup distributing files like these are very hefty jobs. Well if you are planning to distribute an installer file or executable file(Both EXE) for WINDOWS machine ... Read More »
Android Toast like message dialog in Java Swing
Android Toast like message dialog in Java Swing If you are using SwingWorker background thread for doing long operations and if you want user to see some useful information then ofcourse you need to use process() function as it is invoked by Event Dispatcher Thread. But if you using JOptionPane.showMessageDialog(null, “message”); you can invoke message dialog from background worker thread. ... Read More »
Periodic repetitive background task using Timer task and SwingWorker in Swing
Periodic repetitive background task using Timer task and SwingWorker in Swing Many of you would be aware of Timer task which is part of core java library. It’s used to execute a piece of task after a certain delay periodically on the current thread. This API is very popular and is used in quartz API. But let’s focus our mind ... Read More »
Java Mail API- Reading OUTLOOK mails
Java Mail API- Reading OUTLOOK mails Using JAVA Mail API for reading mails has been common these days. It’s pretty easy to use. Over the internet you can get boilerplate codes for reading mails from GMAIL or YAHOO, however I find a bit tricky when it comes to reading mails from OUTLOOK. GMAIL and YAHOO provides settings feature where you ... Read More »
Windows BAT file to execute runnable jar file and checks if it is already running
Windows BAT file to execute runnable jar file and checks if it is already running Suppose you have a Java Desktop application, for instance, a SWING application. How would you like to present the runnable JAR file to the client? Am pretty sure many would prefer the BAT script file in case the target machine is WINDOWS based and the ... Read More »
Maven- Creating a Jar together with its dependency Jars into a single executable Jar file
Maven- Creating a Jar together with its dependency Jars into a single executable Jar file Suppose your boss comes and ask you to create a standalone JAVA application. Assuming you being a MAVEN lover, you created a JAVA application using MAVEN dependency management tool. Now suppose you have some MAVEN dependencies that are needed by your JAVA application. Since, it’s ... Read More »