DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: Ok New Question

  1. #1
    Join Date
    Apr 2006
    Posts
    2

    Ok New Question

    I got the scoreboad to work Sort of. Know I am working on a prog that will write text to a file.

    I did it in a consule but cant get it into a G U I ...

    this is what I used and it worked, but know I have to get it into a GUI

    Code:
    package other;
    
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    
    
    public class WritingToFile {
    
        private static void doWrite() {
    
            try {
            
                String fileName = "WritingToFile.out";
    
                BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
                
                out.write("+---------- Testing output to a file ----------+");
    
                out.write(0x0A);
                out.write("\n");
                
                out.write("+---------- Testing output to a file ----------+");
    
                out.close();
    
            } catch (IOException e) {
    
                System.out.println("IOException:");
                e.printStackTrace();
    
            }
    
        }
    
    
        /**
         * @param args
         */
        public static void main(String[] args) {
            doWrite();
        }
    
    }

  2. #2
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    so what's the problem?
    use a button and call in the corresponding action doWrite().

Similar Threads

  1. Display one record at a time!
    By ASP learner in forum ASP.NET
    Replies: 5
    Last Post: 10-08-2002, 07:17 PM
  2. Question on asp.net user/server controls
    By Andy Stephens in forum ASP.NET
    Replies: 1
    Last Post: 09-06-2002, 05:29 PM
  3. question on best programming option
    By James in forum .NET
    Replies: 2
    Last Post: 03-28-2002, 07:14 AM
  4. VB,STORED PROC, COM, DTC QUESTION?
    By melvin ng in forum VB Classic
    Replies: 1
    Last Post: 11-10-2000, 03:46 AM
  5. Performance question
    By John in forum VB Classic
    Replies: 2
    Last Post: 04-05-2000, 09:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links