Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-27-2008, 02:57 AM
Member
 
Join Date: Mar 2008
Posts: 24
Rep Power: 0
Azndaddy is on a distinguished road
Default Help required
Hi

I have a skeleton code in which i want to implement an open and new command.

The code is given below:

import java.util.*;
import java.io.*;
import java.io.FileNotFoundException;

public class Editor
{
public static final Scanner keyboard = new Scanner(System.in);
String fileName;
// Change this! An editor should have a "list" of buffers.
private Buffer buffer;

public Editor()
{
init();
run();
}

private void init()
{
buffer = new Buffer();

}

private void run()
{
System.out.print("> ");
String command = keyboard.nextLine();
if (command.equals("quit"))
{
System.out.println("Bye!");
System.exit(0);
}

else if (command.equals("line"))
{
buffer.printLineNumber();
}

else
{
System.out.println("?");
}

// You will probably like your application to loop at this point.
}

// Make this a proper application.
// Don't remove this line!
public static void main(String[] args) { new Editor(); }
{

}

}

So, i want to implement a command called open, which will open up a buffer, the command asks for additional information by printing "File name:" The user can then enter a file to start the new buffer

The new command, should creates an empty new buffer and it should associates it with a file name, the command will ask for additional information by also printing "File name:"

hope to hear from you, help would be much appreciated

regards
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is required for EJB mmc18 Enterprise JavaBeans 2 07-15-2008 07:16 PM
Blx.tld required anki1234 JavaServer Pages (JSP) and JSTL 5 01-24-2008 05:17 AM
Urgent Help required! WombRaider New To Java 4 01-10-2008 12:26 PM
Quick Job required in Java taxman Jobs Offered 0 01-02-2008 12:46 PM
Help required: regarding java.net.URL api tarzan007 New To Java 3 11-07-2007 05:46 AM


All times are GMT +2. The time now is 11:37 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org