Search Header Logo
ITD102_WEEK14-WEEK15

ITD102_WEEK14-WEEK15

Assessment

Presentation

Computers

University

Practice Problem

Easy

Created by

Wency Jorda

Used 2+ times

FREE Resource

13 Slides • 0 Questions

1

media

Object Oriented
Programming 1

ITD102L

Wency N. Jorda

Instructor

2

media

GUI COMPONENTS

PART 2

3

media

GUI Components:

Jslider

JPopupMenu

JDesktopPane

JInternalFrame

JTabbedPane

BoxLayout

4

media

JSlider

It provides a slider component for selecting a range of values by

sliding a knob along a bar.

Syntax:
JSlider slider = new JSlider(min, max, initialValue);

5

media

Example:

JSlider slider = new JSlider(___, ___, ____);

Syntax:

6

media

JPopupMenu

It provides a context-sensitive pop-up menu that appears when the

user right-clicks on component.

JPopupMenu popupMenu = new JPopupMenu();

JMenuItem item1 = new JMenuItem(“Option1");

JMenuItem item2 = new JMenuItem(“Option2");

popupMenu.add(item1);

popupMenu.add(item2);

Syntax:

7

media

Example

JPopupMenu popupMenu = new JPopupMenu();

JMenuItem _____ = new JMenuItem(“______");

JMenuItem _____ = new JMenuItem(“_______");

popupMenu.add(_____);

popupMenu.add(_____);

Syntax:

8

media

JDesktopPane

A container used to hold multiple JInternalFrame components, which

allows an Multiple Document Interface within a main window.

JDesktopPane desktopPane = new JDesktopPane();

JInternalFrame internalFrame = new JInternalFrame("Internal Frame", true,

true, true, true);

desktopPane.add(internalFrame);

Syntax:

9

media

JDesktopPane

1stTrue
Resizable

2ndTrue
Closable

4thTrue
Iconifiable

3rdTrue
Maximizable

10

media

JTabbedPane

Used to create a tabbed interface that allows switching between panels by

clicking on tabs

JTabbedPane tabbedPane = new JTabbedPane();

JPanel panel1 = new JPanel();

tabbedPane.addTab(“Name of tab", panel1);

Syntax:

11

media

Example

JTabbedPane tabbedPane = new JTabbedPane();

JPanel ______ = new JPanel();

JPanel ______ = new JPanel();

tabbedPane.addTab(“_______", _______);

tabbedPane.addTab(“_______", _______);

Syntax:

12

media

BoxLayout

Layout manager that arranges components either vertically or horizontally

JPanel panel = new JPanel();

panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));

panel.add(new JButton("Button 2"));

panel.add(new JButton("Button 3"));

Syntax:

13

Discover new features in Lessons!
Finish all phases of “I-do ; We-do ; You-do” with Quizizz

media
media
media
media

​You can also create lessons directly on Google Slides using “Quizizz Extension”.
Read more about it here

media

Object Oriented
Programming 1

ITD102L

Wency N. Jorda

Instructor

Show answer

Auto Play

Slide 1 / 13

SLIDE