aspose file tools*
The moose likes Cattle Drive and the fly likes How Do I Format Text? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "How Do I Format Text?" Watch "How Do I Format Text?" New topic
Author

How Do I Format Text?

P. Larson
Greenhorn

Joined: Sep 21, 2013
Posts: 8
I'm trying to do assignment 5, where you make a times table chart. Can anyone please give me a better example of format text? Because this is my first time ever trying to do format text. Thank You !!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36579
    
  16
What sort of formatting code have you got already?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10925
    
  12

What do you mean by "assignment 5"? Where is this assignment from?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

The idea with the formatting here is just to make the columns of the times table line up by putting a number of spaces between each entry. There are a number of possible ways to make that happen, so it's up to you to find one that works. Have you been able to output the table at all yet?

Also, you should post questions about Cattle Drive assignments in the Cattle Drive forum. You're welcome to ask questions about the the underlying Java code in Beginning Java, but you'll have to frame the question that way. Referencing "Assignment 5" in any other forum likely won't make sense to anyone there.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36579
    
  16
Do Cattle Drive assignments use a particular version of Java?
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

They were created for Java 1.4. I'm in the process of updating the Servlet assignments to Java 7, and I believe Katrina is working on updating the earlier assignments. I'm not sure how far along she is though.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36579
    
  16
Does anybody know where there are archives of the old version of the Java Tutorials? The up to date Java tutorials have two sections which may be relevant: 1 2. But the %d tags were not available in JDK1.4, so you end up having to use a NumberFormat instance, probably a DecimalFormat instance. You should find an example in one of those tutorial links, I think No 1. It should be easy enough to work out a pattern of ### for whole numbers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Do I Format Text?
 
Similar Threads
Color setting
colors in command prompt
Extract TExt from pdf
Calling a Hashtable from another class.
Auto Increment Row number