Java is one of the modern programming languages available today. Its write once, run everywhere approach makes it a top choice for developers. Coding in Java is easy and hassle free. You may be already creating small programs in it. Why just be limited to console-based programming when you can actually learn to create multi-platform GUI(Graphical User Interface) based software.
This course is for Swing. Swing provides the default tools in Java to create rich Graphical User Interfaces. Mastering Swing will ensure that you can handle real world projects that involve complex GUI. This guide will go through each and every aspect of Swing one by one.
This Course consist of Quizzes and Assignments.
Quizzes will ensure you are learning the concepts properly. Assignments will ensure you are actually applying the concepts properly. Solutions are included in the form of tutorial lectures at the end of the course.
Bonus: New content will be made available to you time to time to keep this course fresh and latest at no extra cost.
You will learn, what is JFC. The features of JFC and a brief overview of Swing Packages
This video shows how a simple java program using Swing looks like and the Output of the program when you compile it.
Create your first swing application.
Learn to use the two basic swing components:
Also learn how to call the GUI code from the main method of your Java code using SwingUtilities class
Just a revision of what you studied so far in this section.
You will learn about Swing Containers and Components and how they are used in the program.
In this lesson, you will learn to create an application's main window using the JFrame class of javax.swing .
In this lecture, you will learn to give a Title to your application window that will be displayed at the top and you will also learn how to set a minimum size so that the application window could only be resized to some specific dimension.
You will learn to set a default close operation to your Application Window. The default behaviour of the close button of the application window is to hide the window instead of terminating the application. After this lecture you will be able to override this default behaviour and make the application terminate when someone clicks on the close button of the application.
After you create a Window, its just blank... In this lecture, you will learn how to add three basic components(Label, Button and Text Field) to the Window and how to organise them using a layout(Flow Layout).
In this lecture, you will learn How to create a button using the JButton class of java.swing.*
You will also, learn how to show a default text on the button and finally, How to display it in the application window.
In this lecture, you will learn how to create Checkboxes, showing text on them and displaying them in your application window.
In this lecture, you will learn to create radio buttons, displaying default text in them and finally adding it to the application window. You will also learn, how to use Button Group so that you can group the radio buttons which will make only one radio button selectable in the group at one point of time.
You will learn to create a Toggle Button. A Toggle button is similar to ON/OFF button. When you click on it, it hold its pressed state and when you click on it again, it comes back to its original state.
You will learn how to add an action listener to a button. It will allow a button to perform some task when someone clicks on it.
In this lecture you will learn to add an action listener to a checkbox. When the checkbox is checked, it will perform something and when the checkbox is not checked, it will perform something else, according to your requirement.
You will Learn to add action listeners to a group of Radio Buttons and control their functionality according to their selection.
You will learn how to add an action listener to a toggle button to check when the toggle button is in pressed state or in unpressed state and perform some action accordingly.
Assignment 1: Create a Java Swing Quiz Application. This video shows what you are expected to create and how your application is supposed to perform.
Assignment 1: Create a Java Swing Quiz Application. This document contains the problem statement and program requirement. Download or Print the document for your reference when to solve the problem.
In this lecture, you will learn how to create an Un-editable ComboBox, i.e., a Dropdown that will hold a list of items and you can select one of them.
In this lecture, you will learn how to create an editable ComboBox that let the user to choose from a dropdown list as well as allow them to write free text in the field. This lecture is an extension of the previous lecture and only shows you how to convert the uneducable ComboBox into an Editable one.
In this lecture you will learn how to add an action listener to a ComboBox and getting the name of the selected item from it.
In this lecture you will learn, how to get the index of the selected item in the ComboBox. The index is usually used to get the position of the selected item in the ComboBox. Based on the index, you can program your application to do specific task, which is more practical in most situation that consist of dealing with hundreds of list items.
In this lecture, you will learn how to create a Text Field in Swing. You will also learn how to use various constructors of the JTextField Class to create variety of Text Fields.
In this lecture, you will lean how to fetch the text from a text field and display it on a Label when someone clicks on a Button. You will also learn, How to set the Text Field Uneditable so that users can't type text in it.
In this lecture, you will learn How to create a Password Field to accept passwords from your user. A Password Field hides the actual characters from being displayed. You will also learn how to set an Echo Character, which will allow you to set a custom character( default is Asterisk character) to hide the actual password.
In this lecture, you will learn how to convert your Password Field into a Text Field. This is useful when you want to give your user a choice to display their typed password. So, we will add a checkbox called "Show Password" that will display the actual password when checked and will hide the characters when unchecked.
In this lecture, you will learn how to create a formatted text field and how to specify a format mask to it so as to limit the user to a specific format. It is helpful when you are trying to create a Serial Number field in your application.
In this lecture, you will learn how to create a JTextArea that will allow you to read multiple lines of text from the user. Its one step ahead of the JTextField you learned already.
In this lecture, you will learn how to create a spinner and use its number model. The number model will allow you to specify a current value to set to the spinner as well as minimum and maximum values. You can also specify the steps by which the values should increase or decrease in the number model.
In this lecture, you will learn how to use the Spinner List Model and display the strings in a string array as items in the Spinner.
In this lecture, you will learn to use the Date Model of the Spinner. It will allow you to create a Spinner with some default Date. The user can select in-between minimum and maximum dates. You can also specify steps at which your date should increase or decrease.
In this lecture, you will learn how to create a slider which is a visual component that lets you choose a value in-between two integers by sliding a knob across the track. You will learn how to make it visually appealing by showing two type of tick marks, minor and major. Setting a Label at Major position gives the user a feedback at which value the slider is residing.
In this lecture, you will learn how to create a Label Table for Slider to display alternate text to it instead of the default number values it shows. This lecture requires the knowledge of creating Hash Tables in Java but I have briefly covered the basics which will be more than enough for this tutorial.
In this lecture, you will learn how to get the value from a slider and use that value in your application. In my example, I will get the value from the slider and based on whether the value is greater than or less than 5, it will set some text on a Label.
In this lecture, you will learn how to set a value to the slider to position its knob programatically based on condition.
In this lecture, you will learn how to create a Slider with vertical orientation.
Assignment 1: Create a Java Swing Quiz Application. This document contains the problem statement and program requirement.
In this tutorial, I will show you how to Start the QuizApp Project in Eclipse and we will create the Application Window, give a title as well as give it a proper size.
In this tutorial, I will show you how to add the questions, options, submit button and the result label to our application window. This will complete the GUI for the QuizApp.
In this tutorial, I will show you how to add the action listener to the submit button in our Quiz Application to calculate the score and display the score in the Result Label.
Prasun started programming at the age of 11. He holds a Bachelors degree in Computer Science and currently working as a Web/Application Developer in a MNC. He is also the founder and CEO of his startup, Xibeat Technologies that published their first app for android completely free of cost.
Prasun is very passionate about programming languages and UX design. He is comfortable with major programming language that include but not limited to C, C++, C#, Java, Python, PHP, HTML5, CSS3. He keep learning new technologies time to time. Currently he is working on his paper on a security algorithm that may get a patent in near future.
Being a self-learned person, Prasun got an extra edge over other people which allowed him to explore easy and effective way to solve a problem/challenge that is perceived tough by most of the people.
Prasun is not just limited to only programming languages and algorithms. He has keen interest in Sketching, Singing and Playing Guitar.
Finally, Prasun has decided to share his expertise with people around the world through his lineup of online courses across various domains. Hope you will enjoy learning with him!