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

GUI problem

 
Nate Hur
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a GUI using a boxlayout. The user is able to enter a string and this string will be displayed in a JLabel. However, when the string is placed in the JLabel all of the other components in the boxlayout shift to right as the length of the string increases. Is there any way I can prevent all of my components from shifting right when the length of the string increases?
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Format the string entered by the user so that it fits in the space you've allowed it to have in your BoxLayout. That's the best I can do without seeing some code.
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cross posted. Was also rude to a moderator on the other forum in another thread.
http://www.java-forums.org/awt-swing/35576-boxlayout-question.html
 
Maneesh Godbole
Saloon Keeper
Posts: 11179
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The cross post on the other forum has since been deleted.
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The cross post on the other forum has since been deleted.


You guys are tough. I'm reminded of the quote from the old westerns from the good guy to the bad guy before the bad guy does something heinous, "I'll hunt you down and kill you, every mother's son of you!"

I suggest a moment of introspection to remember where you've been, how you've gotten where you are, who taught you the lessons you'll never forget that you consider the most valuable, what you'd like to teach others, and how you think that might be accomplished most effectively based on your own experiences. Are those lessons guiding the approach presented here?

Have a nice day!
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you had seen the rudeness on the other website, you would have deleted it too.

It is only by being tough that one can maintain the sort of atmosphere where people can learn. And if you want to discuss this any further, you ought really to open a thread on the "Ranch Office" forum, where we usually discuss that sort of question.
 
Rob Spoor
Sheriff
Pie
Posts: 20667
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greg Brannon wrote:
The cross post on the other forum has since been deleted.


You guys are tough.

Ehm, we at the Ranch have nothing to do with what goes on in other forums like java-forums.org. That's a completely different site, unaffiliated with us. If you have any problems about the removal of your thread on that forum, please complain on that forum, not here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic