12/3/2023 0 Comments Swing in java![]() ![]() Swing is a light-weighted, GUI (graphical user interface) that is used for creating different applications.Here are following takeaways from this article: The method, setBounds are used for setting up the co-ordinates.The components are then added onto the window and the awt app is called inside the main function. Components used are, label, text area and buttons. The awt function is called from the package and its components are initilized before using it. In the code given, the package is imported and class is extended by the main class. ![]() The only difference is that we will be using AWT for building the app. Java Awt ExampleĬonsider a following example, In this we are building same application form as that of swing. ![]() The main difference between AWT and Swing is that AWT is purely used for GUI whereas Swing is used for both, GUI as well as for making web application. It is generated by system’s host operating system and contains large number of methods and class which are used for creating and managing UI of an application. It was developed by Sun Microsystems In 1995 and is heavy weighted. It is a platform dependent API used for developing GUI (graphical user interface) or applications that are window based. What Is AWT?ĪWT also known as Abstract window toolkit. The code then gets executed and the output is shown. In the main method, the swing class object is initialized and called. The inner component of window like label, text area and buttons objects are initialized and used respectively. After this JFrame is initialized which is used for making application's window. In this, the swing package is first imported and its app is initialized. In this example, we will be creating a user form using the swing component of Java which is provided by javax.swing package. While panel on the other hand has an applet that is used for embedding another program inside an application. The frame is used for outer covering while dialog also known as dialog box is used widely for user input and for output. The window has two objects, Frame and Dialog. The container is the outer part of GUI, it is further divided into two parts:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |