Forums Register Login

Fill in the blanks..

+Pie Number of slices to send: Send
This question is from Khalid's mock test.
Can anybody tell me the correct answer...
Write a line of code that declares a variable named layout of type LayoutManager and initializes it with a new object, which when used with a container can lay out components in a rectangular grid of equal-sized rectangles, 3 components wide and 2 components high.
+Pie Number of slices to send: Send
boskey,
The line of code is
LayoutManager layout = new GridLayout(2,3);

Write a line of code that declares a variable named layout of type LayoutManager and initializes it with a new object, which when used with a container can lay out components in a rectangular grid of equal-sized rectangles, 3 components wide and 2 components high.


The line of code is
LayoutManager layout = new GridLayout(2,3);
1. Here layout is of type LayoutManager. LayoutManager is an
interface implemented by GridLayout.
2. layout is initialized with new object
3. GridLayout(2,3) will layout the components in a rectangular
grid of equal-sized rectangles, 3 components wide(columns)
and 2 components high(rows).
I hope this helps.
Suma.

[This message has been edited by Suma Narayan (edited June 07, 2000).]
+Pie Number of slices to send: Send
Thanks Suma.
+Pie Number of slices to send: Send
Can you tell me the mock exam's URL?
Thanks!
It's never done THAT before. Explain it to me tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 721 times.
Similar Threads
Adding components dynamically
swing
Wrap Text in a JButton
Background Color
Setting Focus in a Panel, not frame?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:12:24.