Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

FinalExam Review Sp2005: Compare the GUIs

Post Answers, Questions, Comments, etc. here.

(Back to Final Exam Review Sp2005)


A. The tree diagrams are the same.
B. What the user sees is different in each example because the first example renders a flowlayout and the second example renders a borders layout. So, the first example will have two buttons right next to each other, with no extra space. Example two, the border layout will have two buttons right next to each other as well, but the center will have more space.

What will happen when you resize the window? That's key. (Hint: Use the word "rendering" somewhere in your answer.) Mark Guzdial

B. When you resize the window, the layout that was originally rendered will not change, the buttons will move to accommodate the layout that is in place regardless of what size the window is changed to.

Is that what you meant?

That's the kind of answer I mean, but this answer is actually wrong. Mark Guzdial


A. Is this what you want for drawing the trees?

GUI 1
panel1–>panel2

GUI 2
panel1
(arrow pointing down)
panel2

If not, what do you want for part A? I understand how the GUI looks, but not how you want us to draw the tree representing the GUI.

B. Is this what you want for B.? What else would I say about the tree structure? Did I use render the way you want?

When GUI 1 is rendered the user sees a GUI with everything in a line, when they resize the window everything stays in a line at the top. When GUI 2 is rendered the user sees a window with "This is panel 1!" at the top and the two buttons at the bottom. When the window is resized the "This..." always stays at the top and the buttons always stay at the bottom. The differences in the structure of the trees account for this (FlowLayout vs. BorderLayout).



Yes, that's the right description – but WHY? It's the same tree (root has two children, panel1 and panel2. Panel1 has one child, a label. Panel2 has two children, the two buttons). So how could the same tree look different? Because it's rendered using different algorithms. FlowLayouts put everything in a line – no matter how big the underlying window, it'll still all be in the same line. BorderLayouts line up elements of the tree with borders. Panel1 will always be against the top edge (NORTH border), and Panel2 will always be against the bottom edge (SOUTH border). It'll never fill in the Center, because of the way it's rendering. Same tree, two different decisions about how to algorithm, two different looks. (Remember Charlie's question Friday about sounds processing Next first or REMOVEDldren first? That's a different rendering decision that would lead to two different sound sequences.) Mark Guzdial




Link to this Page