Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-27-2008, 03:57 AM
Member
 
Join Date: Mar 2008
Posts: 24
Azndaddy is on a distinguished road
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
Sponsored Links
Reply


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

vB 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 08:16 PM
Blx.tld required anki1234 JavaServer Pages (JSP) and JSTL 5 01-24-2008 06:17 AM
Urgent Help required! WombRaider New To Java 4 01-10-2008 01:26 PM
Quick Job required in Java taxman Jobs Offered 0 01-02-2008 01:46 PM
Help required: regarding java.net.URL api tarzan007 New To Java 3 11-07-2007 06:46 AM


All times are GMT +3. The time now is 12:28 PM.


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