Python Tkinter | Create LabelFrame and add widgets to it Last Updated : 11 Jul, 2025 Comments Improve Suggest changes 9 Likes Like Report Tkinter is a Python module which is used to create GUI (Graphical User Interface) applications. It is a widely used module which comes along with the Python. It consists of various types of widgets which can be used to make GUI more user-friendly and attractive as well as functionality can be increased. LabelFrame can be created as follows: -> import tkinter -> create root -> create LabelFrame as child of rootlabel_frame = ttk.LabelFrame(parent, value = options, ...) Code #1: Creating LabelFrame and adding a message to it. Python3 # Import only those methods # which are mentioned below, this way of # importing methods is efficient from tkinter import Tk, mainloop from tkinter.ttk import Label, LabelFrame # Creating tkinter window with fixed geometry root = Tk() root.geometry('250x150') # This will create a LabelFrame label_frame = LabelFrame(root, text='This is Label Frame') label_frame.pack(expand='yes', fill='both') label1 = Label(label_frame, text='1. This is a Label.') label1.place(x=0, y=5) label2 = Label(label_frame, text='2. This is another Label.') label2.place(x=0, y=35) label3 = Label(label_frame, text='3. We can add multiple\n widgets in it.') label3.place(x=0, y=65) # This creates an infinite loop which generally # waits for any interrupt (like keyboard or # mouse) to terminate mainloop() Output: Code #2: Adding Button and CheckButton widgets inside LabelFrame. Python3 # Import only those methods # which are mentioned below, this way of # importing methods is efficient from tkinter import Tk, mainloop from tkinter.ttk import Checkbutton, Button, LabelFrame # Creating tkinter window with fixed geometry root = Tk() root.geometry('250x150') # This will create a LabelFrame label_frame = LabelFrame(root, text='This is Label Frame') label_frame.pack(expand='yes', fill='both') # Buttons btn1 = Button(label_frame, text='Button 1') btn1.place(x=30, y=10) btn2 = Button(label_frame, text='Button 2') btn2.place(x=130, y=10) # Checkbuttons chkbtn1 = Checkbutton(label_frame, text='Checkbutton 1') chkbtn1.place(x=30, y=50) chkbtn2 = Checkbutton(label_frame, text='Checkbutton 2') chkbtn2.place(x=30, y=80) # This creates infinite loop which generally # waits for any interrupt (like keyboard or # mouse) to terminate mainloop() Output: Note: One can also add another LabelFrame inside another LabelFrame, as well as one can do styling of any LabelFrame like we do the styling of other widgets. Create Quiz Comment S sanjeev2552 Follow 9 Improve S sanjeev2552 Follow 9 Improve Article Tags : Python Python-tkinter Python-gui Explore Python FundamentalsPython Introduction 2 min read Input and Output in Python 4 min read Python Variables 4 min read Python Operators 4 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 5 min read Python Functions 5 min read Recursion in Python 4 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 4 min read Python Tuples 4 min read Python Dictionary 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 5 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 3 min read Python MySQL 9 min read Python Packages 10 min read Python Modules 3 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 4 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 3 min read StatsModel Library - Tutorial 3 min read Learning Model Building in Scikit-learn 6 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 6 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 5 min read Build a REST API using Flask - Python 3 min read Building a Simple API with Django REST Framework 3 min read Python PracticePython Quiz 1 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like