Results 1 to 3 of 3
Thread: Help making table
- 01-26-2009, 06:16 AM #1
Member
- Join Date
- Nov 2008
- Posts
- 9
- Rep Power
- 0
Help making table
I am trying to make a table of all the ASCII characters but am having some trouble. I have all the characters printed in a list order, but need to make it into about 10 columns across. Any help is really appreciated. Here is my code so far...
Java Code:import corejava.*; public class Ascii { public static void main(String[] args) { System.out.println("\tStandard ASCII Codes"); System.out.println("008 - BS"); System.out.println("009 - TAB"); System.out.println("010 - LF"); System.out.println("013 - CR"); for (int i = 33; i < 127; i ++){ Format.print(System.out, "%03d", i); System.out.println(" - " + (char)i); } System.out.print("127 - DEL"); System.out.println(""); System.out.println(""); String prompt = Console.readString("Press Enter to Continue"); System.out.println(""); System.out.println("\tExtended ASCII Codes"); for (int i = 128; i < 256; i++){ System.out.println(i + " - " + (char)i); } }
- 01-26-2009, 06:35 AM #2
i don't have corejava.* so i can't compile it and test it out.
but i would use two loops,
Java Code:for (int i = 33; i < 127; i ++){ loop*(j<11){ [B]// <-- LOOP + CONDITION[/B] Format.print(System.out, "%03d", i); System.out.print(" - " + (char)i); [B]// <-- EDITED[/B] } }Last edited by angryboy; 01-26-2009 at 06:38 AM.
USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
- 01-26-2009, 03:53 PM #3
Similar Threads
-
Need helps making counter
By Lifeis2evil in forum New To JavaReplies: 3Last Post: 11-26-2008, 11:58 PM -
Making a Table Row with JPanel Composed of JTextField and JComboBox Selectable
By datechie in forum AWT / SwingReplies: 2Last Post: 07-30-2008, 12:33 PM -
Making a stack from a LinkedList
By Java Tip in forum java.langReplies: 0Last Post: 04-16-2008, 10:28 PM -
Making triangle
By banie in forum New To JavaReplies: 4Last Post: 02-02-2008, 11:23 AM -
Help with making this algorithm better
By RLRExtra in forum New To JavaReplies: 6Last Post: 01-17-2008, 04:11 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks