Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 18th, 2008, 02:11 PM
jalek jalek is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 1 jalek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 10 sec
Reputation Power: 0
Exclamation how do I display everything on a seperate line?

This is the code I have for all my attributes.

I need them all to be on seperate lines.

myLabel = new JLabel ( String.format( "%s, %d\r\n, %s, $%.2f, $%.2f, $%.2f, $%.2f", Products[displayProduct].getproductName(),
Products[displayProduct].getproductNumber(), Products[displayProduct].getproductColor(),
Products[displayProduct].getproductUnits(), Products[displayProduct].getproductPrice(),
Products[displayProduct].getcalculateUnits(), Products[displayProduct].getrestockFee()) );

I would like it to look like this:
Product name:
Product Number:
Product Color:
Product Units:
Product Price
Product total value:
Value w/ restocking fee:

anyhow, any help would be great.

Reply With Quote
  #2  
Old March 20th, 2008, 03:41 AM
Annie79 Annie79 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2007
Location: Beaverton OR
Posts: 17 Annie79 User rank is Just a Lowly Private (1 - 20 Reputation Level)  Folding Points: 49426 Folding Title: Beginner FolderFolding Points: 49426 Folding Title: Beginner FolderFolding Points: 49426 Folding Title: Beginner Folder
Time spent in forums: 7 h 25 m 11 sec
Reputation Power: 0
You could make it multiline with html tags in the JLabel.

Example:
java Code:
Original - java Code
  1.  
  2. JLabel mylabel = new JLabel("<html><P>This </P><P>is a </P><P>multiline </P>text</html>")

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Compile error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT