Download presentation
Presentation is loading. Please wait.
1
Basic Elements of The GUI
By: Brandon Henderson and James Merino
2
About Graphical User Interface
Commonly used on operating systems such as Windows and Mac Provides a much user-friendly interface for users Are event driven
3
What GUIs look like What Text-Based looks like
4
The Basic Elements of GUIs
JTextField – Input through text Jlabel – Used to display text Jbutton – Input through a mouse click
5
Other more complex GUI elements…
JPanel JComboBox JCheckBox
6
Code snippets JPanel – panel = new Jpanel(parameters go here); JLabel – label = new JLabel(text, additional parameters); JTextField – text = new TextField(text, width, additional parameters); JButton = new Jbutton(text, additional parameters); Requires an action listener method where the code that will be run when the button is pressed can be executed. Adding Elements: panel.add(name of element); button.addActionListener(this);
7
Thanks for listening!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.