This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

a very little prick about JFrame name(or GridBagLayout)  RSS feed

 
Gulsum Ramazanoglu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, I know its trivial, but I cant pass.. I wonder why and I coudnt find out..

Just to try GridBagLayout, I wrote a very simple program.. When I use BorderLayout it shows the title of the JFrame object("Sağlayıcı Firma Girişi"), when I use GridBagLayout it doesnt! Why? If you have any idea and share it with me, I will be happy. Thank you

Here is the code:
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gulsum Ramazanoglu:



You arent passing the title to the super constructor.
 
Campbell Ritchie
Marshal
Posts: 55717
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suggest you go to Cai Horstmann's web page and look for his GBC class which makes use of GridBagLayout much easier.

Some people find this GridBag tutorial useful . . .



. . . but most people don't. You should still go through it.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GridBag is a nightmare.

http://madbean.com/anim/totallygridbag

I avoid it like the plague. You might consider looking into Miglayout
 
Gulsum Ramazanoglu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People you all tree are very sweet but ...hahaha... Gregg looks suffered a lot! hahaha... ok Gregg I will check it... and Campbell thank you very much I will check that page ...

Maneesh, yes I remember now that the subclass cant inherit the constructor... I have known this.. forgot :roll:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!