File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes GridBag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "GridBag" Watch "GridBag" New topic


lakshmi nair
Ranch Hand

Joined: Oct 11, 2000
Posts: 63
The above code displays 5 buttons. What i want is the second should begin at a position half from the first. I wrote this expecting a result like that. What change must i make?

Aru Ven
Ranch Hand

Joined: Sep 28, 2000
Posts: 199
Thanks. Ur question made me know more about GB.
Did u find out how to do..... Coz from 1 whole day I'm experimenting on grid bag layout but I could not get exactly the o/p.
Do lemme know if u find out something... mean while lemme experiment more.....
Viji Bharat
Ranch Hand

Joined: Sep 18, 2000
Posts: 101
If I have understood you correct, you are looking to implement something like this
<button2> (button2 is right below button1 and its left edge starts exactly at the center of button1)
<button3> (button3 should be right below button2 and its left edge should be exactly at the center of button2)
etc. I haven't been able to do that!!
However I tried other possibilities. The code given below meets your requirements to some extent, I think!

[This message has been edited by Viji Bharat (edited November 22, 2000).]
lakshmi nair
Ranch Hand

Joined: Oct 11, 2000
Posts: 63
Hi Aruna, Viji
I didnt try it further and as you see there are not many replies. Viji's code does not work correctly with me, i dont know why. Anyway less tensed, gave the test today and passed with 83. Time for lot of experiments now!!!
I agree. Here's the link:
subject: GridBag
It's not a secret anymore!