|
-
Jul 12th, 2005, 10:32 PM
#1
Thread Starter
Frenzied Member
GridBag layout problems.{REsolved}
I'm trying to create a calculator using the gridbag layout, but I can't even get started. This layout managers keeps starting stuff in the direct center of the frame and wont put anything anywhere else. I tried this:
c.anchor = GridBagConstraints.SOUTH;
I just can't seem to get this thing working. Could you guys help me out. I hate to ask for some code, but it would really be helpful in this situation.
Last edited by System_Error; Jul 14th, 2005 at 11:09 AM.
-
Jul 13th, 2005, 09:45 PM
#2
Re: GridBag layout problems.
Could you place some code please?
-
Jul 13th, 2005, 09:46 PM
#3
Re: GridBag layout problems.
I just might be able to help.
-
Jul 13th, 2005, 10:22 PM
#4
Dazed Member
Re: GridBag layout problems.
Try
Code:
GridBagConstraints c = new GridBagConstraints();
pane.add(theComponent, c.CENTER);
-
Jul 14th, 2005, 05:17 AM
#5
Addicted Member
Re: GridBag layout problems.
One way would be to not use the hell that is GridBag Constraints, you could use spring layout if all you are after is a simple grid style approach, or write your won layout manager, they aren't that difficult, and give you much much better over the look and feel of your application...
-
Jul 14th, 2005, 11:09 AM
#6
Thread Starter
Frenzied Member
Re: GridBag layout problems.
Thanks guys. I finally got this thing figured out. I just wanted to learn this thing, and to tell you the truth, I won't be coming back to the gridbag layout!! The gridbag layout starts putting everything in the center and when more components are added, it starts to fill out the frame. I really hate that stupid layout manager. Not as good as setbounds() in most ways.
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
|
Click Here to Expand Forum to Full Width
|