Skip to main content

Posts

Showing posts with the label What is Java Swing?

Connection oriented socket programming in java

Write a connection oriented socket program which can exchange the message between server and client once the connection is established. Java Sockets makes networked programming easy. the java.net package offers developers a wide range of tools to create networked applications. the socket class provides the access to a TCP connection between hosts. Unfortunately, it doesn't provide an API for detecting a dropped connection from the remote system. Java sockets can facilitate both TCP and UDP type protocols. While UDP connections are non-persistent, TCP connections often support a dynamic back-and-forth exchange of information between two network end systems. Example of Java Socket Programming (Read and Write from both client and server) //save this code in file name MyOwnServer.java import  java.net.*;   import  java.io.*;   class  MyFirstServer{   ...

What is Java Swing?

 What is Java Swing?     Java Swing is the java API that can be used to develop more interactive GUI application than AWT in platform independent manner. Swing was added in JDK 1.2 as a part of javax.swing and its subpackages. Swing and JavaBeans allow the GUI builder to write code for you as you place components onto forms using graphical tools. This rapidly speeds development during GUI building, and also allows for greater experimentation and thus the ability to try out more designs and presumably come up with better ones. Java Swing is one of the java library which makes the programming of an application easy  to code. In my opinion the java swing library is easy to learn. Swing is reasonably straight forward, even if you do use a GUI builder rather than coding by hand, the resulting code should still be comprehensible. this solves a big problem with GUI builders used before swing, which could generate unreadable code. Swing is  a ...