Jump to content
  • Advertisement
Sign in to follow this  
loachman

[java] Awt equivelent of new line

This topic is 4031 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I am making an applet and am having trouble aligning my text fields and labels.I am using add(" "); etc basically a bunch of blank space to force a new line. Is there and awt equivalent to the consoles "\n"? Thanks Loachman

Share this post


Link to post
Share on other sites
Advertisement
I would but this is a beginning Java course at the college.Don't want to use that just quite yet as it's a few chapters off. Just thought I'd make it look "Pretty" for the instructor.

Ah well no biggie.......

Thanks
Loachman

Share this post


Link to post
Share on other sites
well, AFAIK, you can't. if you're using swing, you can use HTML in swing elements

JLabel myLabel = new JLabel("<html>line1<br>line2</html>");



or you could use a different element for each line
or you could use a TextArea

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!