DOC PREVIEW
TRINITY CSCI 1311 - GUIs, Events, and Listeners
Pages 7

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1GUIs, Events, and Listeners11/28/20072Opening Discussion■Let's look at solutions to the interclass problem.■Do you have any questions about the project? The project description now gives the details of what you need to give me for the design.3Nesting Layouts■We saw last time that the proper way to position components in GUIs in Java is with Layout Managers. There are some powerful and complex layouts that you can use, but most GUIs can be achieved by nesting simple layouts.■We do this by putting a container object in the proper location in one layout and giving it the layout that we want. In Swing the container that we generally use is a JPanel.4Interacting with GUIs■User interaction with GUIs is very different from the interaction with a text program.■There a multiple things that you can interact with. (buttons, text fields, check boxes, etc.)■The program should just stop waiting for you to interact with something.5Events and Listeners■Alice had events for taking certain user inputs. Java has the same, but as you would guess, we implement them differently.■Different GUI elements have different events that can happen to them.■We register Listeners with GUI elements so that when an event happens, code in the Listener will be called.■Different types of events have different types of listeners. We write subclasses of the listener interfaces that do what we want.6Code■Let's give our programs interactivity. At the very least we should make it so that we can click a button to make something happen.■Many of you might find a JTable useful so let's write a little code that uses one of those as well.7Minute Essay■What parts of building and using a GUI don't make sense to you right now?■The last quiz is at the beginning of next class.■Interclass Problem – Do problem


View Full Document

TRINITY CSCI 1311 - GUIs, Events, and Listeners

Course: Csci 1311-
Pages: 7
Documents in this Course
Arrays

Arrays

12 pages

Arrays

Arrays

10 pages

Applets

Applets

5 pages

Arrays

Arrays

8 pages

Methods

Methods

12 pages

Drawing

Drawing

8 pages

Load more
Download GUIs, Events, and Listeners
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view GUIs, Events, and Listeners and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view GUIs, Events, and Listeners 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?