Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

GridBagLayout and placements  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, first time poster!

I just started teaching myself the basics of Java's JFrame and JSwing. It's all fun and games.

I've heard that GridBagLayout is THE layout to master if you want to make GUIs with Java, and I do, so I'm tying.

Newly, today, I tried making a GUI for myself, with some good results. However I ran into a problem.

My code is as follows:



What this gives me is this wonder:



Bet you can spot my problem?

Why the heck is my text box all the way over there?

How can I make it stick to my "Enter words:" label? You know, as in just to the right of it?

Thanks all, and please, be gentle, I just stared learning this stuff.
 
Marshal
Posts: 59727
187
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I suggest you try some simpler layouts before braving grid bag. You know you can add a panel here and a panel there, and give them different layouts?
 
Patrick Perrin Smith
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch

I suggest you try some simpler layouts before braving grid bag. You know you can add a panel here and a panel there, and give them different layouts?



Thank you!

And yes, that might be the best idea.

Thanks for the tip Campbell, I'll look into some more basic variants to get me comfortable.
 
Campbell Ritchie
Marshal
Posts: 59727
187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!