File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes GUI problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "GUI problem" Watch "GUI problem" New topic
Author

GUI problem

Nate Hur
Greenhorn

Joined: Dec 02, 2010
Posts: 2
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

Joined: Oct 24, 2010
Posts: 563
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.


Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

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


luck, db
There are no new questions, but there may be new answers.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

Thanks Darryl.

Nate please read http://www.coderanch.com/how-to/java/BeForthrightWhenCrossPostingToOtherSites


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

The cross post on the other forum has since been deleted.
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 563
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

Joined: Oct 13, 2005
Posts: 40061
    
  28
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

Joined: Oct 27, 2005
Posts: 19792
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GUI problem