Button by tkinter in python by R4R Team

-Button widget is used to create a new button in the window screen.

Syntax-

b=Button(window, option=value)


program-



from tkinter import *

win=Tk()

win.title("My first page")

button1=Button(win,text="Click1")
button1.place(x=40,y=40)

button2=Button(win,text="Click2")
button2.place(x=200,y=200)

win.mainloop()


output-




-In this program, we create a two button named as click1 and click2,
-button.place(x,y) is used to place a button in the window according to the x,y coordinate.
-Here button1 and button2 are the objects of the both button.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!