-
GridLayout in applets
I'm having a slight bit of trouble deciphering what the parameters in "setLayout(new GridLayout(x,y));" do.
I've mostly figured that 'x' is the number maximum number of objects in a column (I think), but I can't figure out what exactly the 'y' variable specifies.
Anyone know offhand?
-
first no is number of rows, second is number of columns
if you want
button button
button button
...
...
then use GridLayout(0,2)
if you want
button button button ... ...
button button button ... ...
then use GridLayout(2,0)
best thing to do is try both and see what difference it makes so that the layout appears how you want
-
Originally posted by boroski
first no is number of rows, second is number of columns
if you want
button button
button button
...
...
then use GridLayout(0,2)
if you want
button button button ... ...
button button button ... ...
then use GridLayout(2,0)
best thing to do is try both and see what difference it makes so that the layout appears how you want
i take it that 0 means continue forever? is that what your dots mean?
-
yeah the dots mean carry on ie there is no bounds (which is coded with 0)
-
quick clarification
If I do GridLayout(2,2), does that mean I can only use 4 buttons, in a
button, button
button, button
format?
-
try it 
either:
the 5th addition will overwrite teh first
or an exception will be thrown
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks