Skip to content

Hands-on repository for learning Java Swing, focusing on GUI development and event handling. Includes beginner-friendly examples, practice exercises, and a Basic Calculator project. Perfect for building interactive desktop applications. Designed for 2nd-year ISE students.

Notifications You must be signed in to change notification settings

VoidGeek/JavaSwingWorkshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Java Swing Workshop

Welcome to the Java Swing Workshop! This hands-on session covers the basics of Swing programming and event handling for building GUI applications in Java.


Workshop Flow

Time Topic Details
1:30 - 1:35 PM Setup Install IntelliJ IDEA, configure Java SDK, and set up a basic project.
1:35 - 1:45 PM Introduction to Swing Overview of Swing, its architecture, and comparison with AWT.
1:45 - 2:00 PM First Swing Application Hands-on: Write a minimal Swing program using JFrame and JLabel.
2:00 - 2:15 PM Swing Layouts and Components Add multiple components with layouts like FlowLayout, BorderLayout, and GridLayout.
2:15 - 2:35 PM Event Handling Build an interactive program demonstrating ActionListener and KeyListener.
2:35 - 3:25 PM Hands-On Project: Calculator Create a basic calculator with buttons for arithmetic operations.
3:25 - 3:30 PM Closing and Q&A Summarize the topics, share resources, and address questions.

Source Code

Programs Covered:

  • SwingIntro.java: Minimal Swing application.
  • SwingLayouts.java: Example of layouts and multiple components.
  • EventHandling.java: Example of button clicks and key press events.
  • Calculator.java: Hands-on project to build a functional calculator.

How to Clone and Run in IntelliJ

Step 1: Clone the Repository

  1. Open IntelliJ IDEA.
  2. Go to File > New > Project from Version Control.
  3. Select Git and provide the repository URL in the prompt.
  4. Choose a directory on your machine and click Clone.

Step 2: Open the Project

  1. IntelliJ will automatically open the cloned project. If not, go to File > Open and select the cloned folder.

Step 3: Configure the SDK

  1. Go to File > Project Structure > SDKs.
  2. Click + and select Add JDK.
  3. Navigate to your installed JDK (e.g., Java 21) and click OK.

Step 4: Mark src as Source Root

  1. Right-click the src folder in the Project view.
  2. Select Mark Directory as > Sources Root.

Step 5: Run a Program

  1. Locate the desired file in the src folder (e.g., SwingIntro.java).
  2. Right-click the file and select Run 'SwingIntro.main()'.

Resources

  1. Swing Documentation: Official Oracle Swing tutorial.
  2. Java SDK Downloads: Download Java 21 LTS.
  3. IntelliJ IDEA Guide: Follow the installation guide in the setup/ folder.

Happy coding! 🚀

About

Hands-on repository for learning Java Swing, focusing on GUI development and event handling. Includes beginner-friendly examples, practice exercises, and a Basic Calculator project. Perfect for building interactive desktop applications. Designed for 2nd-year ISE students.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages