Java Reference
In-Depth Information
45.
constraints.weightx = wx;
46.
constraints.weighty = wy;
47.
gbl.setConstraints(Comp,constraints);
48.
}
49.
50.
public static void
main(String[] args){
51.
GridBagFrame gridbagFrame =
new
GridBagFrame();
52.
gridbagFrame.showIt("Grid-Bag Layout");
53.
54.
}
55.
}
Exercises
17.1
Change the constraint parameters for some of the panels in application
Grid-
BagFrame
. Look at the result and explain why it looks the way it does.
17.2
Change method
easyConstraints
so that the
fill
value can also be set.
Try different settings and explain the result.
17.3
Design a grid-bag layout for the GUI in Figure 17.5.
C
B
D
A
E
G
F
H
J
Figure 17.5 Sketch of the GUI to be designed in Exercise 17.3
Search WWH ::
Custom Search