Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lining up in the same line in GridBagLayout

 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please have a look at the following code

The above is the maximum shortened code possible. Removing further more elements will not display the original error.

OK. Now the problem is about alignment. Once you run the code, you will see the following.


As you can see in there, there elements in the `southPanel` are not aligned well with `centerPanel`. Which means, I expect that `southPanel` JLabels to come into the same line where the `centerPanel` JLabels start. But it ended up in this way. I want the JLabels in `southPanel` to be appeared in the same line where the JLabels of `centerPanel` begins. What I am telling is clearly displayed in the following image. How can I do it? Please help!

PS: I am attaching the "Test Image" as well, so you can test it if you want.

PS: Some suggested me to have everything inside the centerPanel. But the case is, I need 2 panels, because I need to display "titles" in that manner, as getting displayed in "TitledBorder".

PS: I noted performing minus values will do the trick. But most developers says it will make troubles.



Please help!
TESTING-LOGO.gif
[Thumbnail for TESTING-LOGO.gif]
The LOGO
what-I-get.png
[Thumbnail for what-I-get.png]
What I Get
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This image explains what I want
what-I-wantr.png
[Thumbnail for what-I-wantr.png]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have the replies at StackOverflow resolved the problem?
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn wrote:have the replies at StackOverflow resolved the problem?


Hi, Thank you for the reply. No I didn't get any help. There is no understandable answer there, which should contain some kind of UNDERSTANDABLE code snippet. Please help.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50241
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think MD was alluding to this.
 
m Korbel
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and quite good answered (twice asked question) on another forum
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic