Results 1 to 11 of 11
Thread: formatter shows nothing
- 12-25-2012, 03:33 PM #1
Member
- Join Date
- Oct 2012
- Location
- ph
- Posts
- 43
- Rep Power
- 0
formatter shows nothing
please i need some help in printing the formatted data out in the text file named acc.txt but it doesnt work ....it builds but the text file remains empty.
Please help me...where am i wrong?
import java.util.Formatter;
public class make acc
{
public static void main(String[] args)
{
Formatter make;
make = new Formatter("C:\\acc.txt")
make.format("%s\n%s","i love java","i know duke");
}
}joy wouldnt feel so gud if it wasnt for pain.gif)
- 12-25-2012, 04:28 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,412
- Blog Entries
- 7
- Rep Power
- 17
Re: formatter shows nothing
Close the formatter before you exit your program (read the API documentation for the Formatter class). b.t.w. a class name cannot have spaces in them.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-25-2012, 05:45 PM #3
Member
- Join Date
- Oct 2012
- Location
- ph
- Posts
- 43
- Rep Power
- 0
Re: formatter shows nothing
that is just a mistake i made while typing it in here....anyway i'll check it out...thanks a lot!!
joy wouldnt feel so gud if it wasnt for pain.gif)
- 12-25-2012, 06:08 PM #4
Member
- Join Date
- Oct 2012
- Location
- ph
- Posts
- 43
- Rep Power
- 0
Re: formatter shows nothing
please help me bro ..i have searched and didnt see a topic for it. My problem isnt with the syntax
joy wouldnt feel so gud if it wasnt for pain.gif)
- 12-25-2012, 08:21 PM #5
Member
- Join Date
- Dec 2012
- Posts
- 12
- Rep Power
- 0
- 12-25-2012, 08:52 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,412
- Blog Entries
- 7
- Rep Power
- 17
Re: formatter shows nothing
Don't ignore what I wrote above: close the Formatter before your program exits.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-25-2012, 09:33 PM #7
Member
- Join Date
- Oct 2012
- Location
- ph
- Posts
- 43
- Rep Power
- 0
Re: formatter shows nothing
i made a mistake while typing here but apart from the syntax error is there anything i did that will make it compile without giving an output in acc.txt or please can i get a tutorial link i searched and didnt get any help
joy wouldnt feel so gud if it wasnt for pain.gif)
- 12-26-2012, 09:47 AM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,412
- Blog Entries
- 7
- Rep Power
- 17
Re: formatter shows nothing
sigh ... invisible ink again ...
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-26-2012, 03:38 PM #9
Member
- Join Date
- Dec 2012
- Posts
- 12
- Rep Power
- 0
- 12-27-2012, 01:23 PM #10
Member
- Join Date
- Oct 2012
- Location
- ph
- Posts
- 43
- Rep Power
- 0
Re: formatter shows nothing
No...what i'm trying to say is that i typed this one saperately...but the one in my IDE has no syntax error...anyway thanks a lot...i found another way of making the text file..
joy wouldnt feel so gud if it wasnt for pain.gif)
- 12-27-2012, 01:55 PM #11
Member
- Join Date
- Dec 2012
- Posts
- 12
- Rep Power
- 0
Similar Threads
-
How to do this with Java Formatter?
By ozzyman in forum New To JavaReplies: 2Last Post: 05-13-2011, 11:33 PM -
Developing Word Writter and Formatter
By Anchal in forum AWT / SwingReplies: 1Last Post: 04-06-2010, 03:35 AM -
Formatter with JOptionPane
By sweetpea123 in forum Advanced JavaReplies: 12Last Post: 03-28-2010, 07:19 PM -
JFormattedTextField / Formatter / OverWriteMode
By Ralphw in forum AWT / SwingReplies: 1Last Post: 08-20-2009, 11:23 AM -
Using java.util.Formatter
By Java Tip in forum Java TipReplies: 0Last Post: 11-16-2007, 02:29 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks