group-icon
Java Developers
Group for Java developers and programmers. Ask questions and get answers related to Java programming
252 Members
Join this group to post and comment.
AdhikariHarika Reshma
AdhikariHarika Reshma
Computer Science
31 Jan 2019

What is Java Swing?

Swing is a GUI toolkit for java.It is one part of the java foundation classes(JFC).Swing includes graphical user interface widgets such as textboxes,buttons,tables.Swing widgets provide more sophisticated GUI components than the earlier Abstract Window Toolkit.It is used to create window based applications and is built on the top of AWT API and entirely written in java.Unlike AWT,java swing provides platform independent and lightweight components.The Javax.swing package provides classes for java swing API such as JButton,JTextField,JTextArea,JCheckBox,JRadioButton,JMenu etc.

Advantages:

1.Swing provides a richer set of components and they are 100% java based.

2.The Swing components can change their appearance based on the current "look and feel" library that is being used.One can use the same look and feel as the platform they are on or can use a different look and feel.

3.Swing provides extra components,such as Icons on many components, Decorative borders for components, Tooltips for components.

4.The components follow the Model View Controller paradigm and thus can provide a much more flexible UI.

Disadvantages:

1.Swing components that look like native components might not act exactly like native components.

2.One should be careful when programming,it can be slower than AWT.

Shruthi Pillai
Shruthi Pillai
Information Technology
1mo ago

Java Swing provides platform-independent and lightweight components.

The javax.swing package provides classes for java swing API such as JButton, JTextField, JTextArea, JRadioButton, JCheckbox, JMenu, JColorChooser etc.


DHIRAJ LOTLIKAR
DHIRAJ LOTLIKAR
Information Technology
1mo ago

Java swing is an API to develop GUI or window based applications in java. It is the part of Oracle's Java foundation Classes(JFC).It was bring upon during the JDK 1.1 version and it is the extended version of  AWT. In short an swing is advanced version of AWT.

 It is light weight and so it is platform independent. Consider you created a java application using swing the output will appear same in all the platforms such as windows, Linux, MAC etc. More features and components compared to AWT. 

It follows MVC. To use swing and you want your application works perfectly you should import swing packagejavax.swing.

Consider the GUI of any online system. The Graphical user interface helps to connect the user to the system. The GUI is does formed by swing. With the help of swing you can design the GUI.

It consist of components and container. The components are the text fields, checkbox, radio buttons etc. while the container is the is the field where all components are placed. The following is the display of a GUI made by swing.


AdhikariHarika Reshma
AdhikariHarika Reshma
Computer Science
1mo ago

@DHIRAJ LOTLIKAR nice.GUI was good.