Skip to main content

Posts

Showing posts from 2018

Java Socket Basics(Socket Programming in Java) Part-1(TCP)

Hi friends, This post is about the Java Socket Programming . I know there are a lot of article and post are available over the internet about Java Socket Programming but all the content like the perquisite of socket programming, example of TCP and UDP is here at one place. So first question, what is TCP and UDP and what is the difference between these two. See below- Perquisite:- There are several things related to socket programming in java which you must not ignore... Do not forget to close the stream or socket connection when the related task is done. Recommended to use try with resource  whenever it is possible. If you are not dealing with  try with resource , then it is highly recommended to close all the resources and related sockets in finally block. java.net.SocketException: Too many open files::   This is an usual exception which generally thrown by Socket. So the question is What may be the possible reasons for  this exception. So go through the follow

JavaFX WebView- Creating Browser Sample

Hi Friends, In this post, i am going to give an overview about JavaFX WebView . This is an embedded browser component which is based on WebKit . If allow you to use Css, JavaScript, HTML5 and more to customise your embedded browser. The embedded browser enables you to perform the following tasks in your JavaFX applications: Render HTML content from local and remote URLs Obtain Web history Execute JavaScript commands Perform upcalls from JavaScript to JavaFX Manage web pop-up windows Apply effects to the embedded browser  I am going to provide and explain you a sample example to create your embedded browser. This is a JavaFX sample example. if you want to take an introduction about JavaFX please visit my previous blog . I have use IntelliJ Idea IDE for this example. You can visit this link  to understand how to create JavaFX application. I am attaching the project structure image below- In this sample- we have two java class. First

An Example to JavaFX

Hi Friends, In previous post i was provided you an small introduction to JavaFX. Lets see an example based on JavaFX. Hope you have downloaded and setup IntelliJ Idea IDE. Note: This example is based on only java classes(Pure java Example). Setting up the JavaFX project(Gradle based) Go to File-> New-> Project and click.One popup dialog will appear. On left panel of dialog, click on gradle. On right panel you will see some check boxes. Select Java and click Next. You will asked to fill some text fields. Enter project's package name in GroupId(i.e com.coderzduniya.fxdemo). Enter project name in ArtifactId(i.e JavaFX Demo). Leave Version as it is and go to Next. Go to Next again and Finish. After doing it well your project will be created. Now right click on java folder inside src/main and go to New-> JavaFXApplication Enter the class name(i.e Main) and click OK. Now copy the following code and paste inside your start method(Method