Need help with a java chat software!!! Anyone pls give ideas

I need to implement a chat protocol with sockets for my course!!
As of now i have only got to the simple client server application with sockets and have a user interface with panels.
How could I proceed...
How should i use login names and passwords??
Should i use if else loops to specify :
various headers like
login
pass
send
exit
if you could point out som esite that will be helpful or even a book it would be of great help!!

Don't use if/else loops, they have this nasty habit of not existing.
My quarter-pence:
For passwords, use a map which maps name/hashed password. That way, you'll never actually store the password.

Similar Messages

  • Need help with error java.lang.IllegalArgumentException: timestamp on bar b

    My company uses Java based applications for real time streaming stock market information and I have come across 2 users that are generating the same error:
    Bar.addBar failed adding com.abwg.bar.BasicBar 20071210-08:27:00.000 104.34 104.35 104.25 104.25 950 to com.abwg.bar.BasicBar 20071210-09:30:00.000 104.11 104.38 104.11 104.38 436 :java.lang.IllegalArgumentException: timestamp on bar being combined older than original bar
    I have had no luck trying to determine what the cause of this error is, however both users experience very laggy performance shortly after launching the application. I have not been able to duplicate the problem, and the developers have not been able to provide any response or possible causes yet.
    I'd be very appreciative if anyone could help me make some sense of what this error type might mean. It's got something to do with the computer that the application is being run on. One user is on a Mac 10.3 using J2SE 1.4.2_12 and the other is on Win XP using Java 1.6_3

    Thank you Frank and Carole for your response. The stated issue/error is resolved. It had to do with the upgrade somehow which lead to multiple certs for the same agent. Anyway, I had to delete ADS and all attached Agents,  re-create ADS, re-create all Agents and re-register with the new ADS. I then manually re-registered the Directory Server instances on both the Primary and Secondary Servers with the new ADS. Voila, the DSCC Web console no longer prompts for server credentials.
    But importing the Wild card cert issue still remains. I added the issuing CA chain to the ldap instance CA store and I see the certs listed. But when I try to import the P12 cert/key combo, I get an error which says something like: "The certificate is already in the database". But it is not, verified using certutil.
    Yes internal CA or Self-signed Certs are fine. If I add the internal CA and Root CA to the cert store on my LDAP clients, then I am fine. No SSL errors. But want to avoid using such as we do have quite a few clients which would be connecting to the store. Hence want to use our  enterprise wild card Cert. I am not sure if it is an issue importing a wild card pkcs12 format.
    As mentioned above I did add the CA chain (which issued the wild card) to the actual instance, not the ADS. I can try that. But are you sure we need to add the Root CA to Tomcat ks.
    And while we are at it, the Self-signed certs generated using the Console is only valid for 2 years. Is it possible to change the term ?
    Thanks again.

  • Need Help with a JAVA programming assignment

    How do I write a JAVA program that could be used as the start of an MS-DOS/Windows simulation of the IEEE 802.3 protocol? I am to only code the parts necessary to build the 802.3 frame. For the initial implementation, the Checksum function need not be a CRC function, and the Destination and Source addresses wil be in input, stored, and output, and in dotted-decimal format.
    I need:
    1. A record to describe the frame, with each field being a (byte-) string of the required size, except that the Data field is of variable size. Although the "Source address" and "Destination address" would be 6 bytes for a real implementation, for this first implementation you can either assume they'll be text strings in the usual "dotted decimal" form (e.g. "14.04.05.18.01.25" as a typical example--from Tanenbaum, p. 429), or 6 hex digits.
    2. Suitable constant declarations for values such as the standard "Preamble" and "Start of Frame" values.
    3. Suitable functions to Get the three variable values "Destination address", "Source address", and "Data" from the standard input device.
    4. A suitable function to display each of the fields of a given frame in a format such as:
    Preamble: ...
    StartofFrame: ...
    Destination: ...
    etc.
    5. A suitable function to generate a "Pad" field if necessary.
    6. A "dummy" Checksum-generating function which just takes the first 32 bits (4 bytes) of the Data (or Data+Pad, if necessary) rather than an actual CRC algorithm.
    I have no experience with Java. Can you help me or start me in the right direction?
    Thanks...........TK

    If you have no experience with Java, then it seems to me your first step should be to start learning the language. But it's difficult to advise how, since we don't know anything about your background. There are many good books available on Java, some are for beginners and some are for advanced programmers, so I'd suggest you go somewhere that has a large selection and start looking for something that doesn't seem completely over your head.

  • I need help with a java assignment

    I am being taught java but dont really understand what i have to do. If you send me an email to [email protected] ill send you a copy and so help me with the assignement.
    I am currently working on free web page so you can download the assignment.
    Thank You All

    hey, there's something wrong with my internet, i clicked on your email adress and nothing happened :(
    too bad. maybe i can't do your assignment.
    go see somee tutorials, maybe these will help you, also try to understand how API will elp you (to both you may find links from left column of this page) and also, see if there area some samples of how to do what you need to be done.
    http://www.javaalmanac.com -- my favorited place for code samples.
    also whan you have some saaignment or other task, then see if google finds you apropriate solution. and there's a search function in these forums as well.
    i hope you get your homework doen in time...

  • HT2305 I need helping with re-installing Apple Software Update for Windows Vista, please. :)

    Hello,  I will get my new Ipad 2 32GB on April, so I will have enjoying with Ipad with bringing up my excitement on Ipad.   I need re-installing Apple Software Update for Windows Vista 32bit, but I did install iTunes, Safari, and Iphone configuration utility that it did not included Apple Software Update software.   Please send me download file of Apple Software Update, immediate.   Thanks
    I do not certain about Ipad configuration utility, would be working with Iphone configuration utility?
    david

    I went into checking with Apple Software Update then I clicked Control Panel  - "Repair"  It was restored to start menu,  thank you much  thumb up to b noir       Big Helping me!  David

  • I need help with this... Anyone?

    Read the following code and:
    a) Explain what the code is supposed to do.
    b) Identify any errors in the code.
    c) If there are errors, please fix them.
    public String mystery(String num) {
    if (num == null) {
    return "N/A";
    int len = num.length();
    int c = 0;
    char[] sb = new char[len];
    for (int i = 0; i < len; i++) {
    sb[c++] = num.charAt(i);
    if ((len - 1 - i) % 3 == 0 && i != len - 1) {
    sb[c++] = ',';
    return new String(sb);
    Assume you are given two fixed lists of numbers (arbitrary size, but you can assume the lists are large):
    a) Write a method that can efficiently find out if there is any element in the 2nd list that is an element of the first list.
    b) Describe some of the tradeoffs you can make with regards to memory and complexity.

    Dear Brett,
    You need to be aware that this site is dedicated to helping those who help themselves. That means helping you debug problems in code that you have written or heling you get a better understanding of something Java related once you tell us what your current understanding is.
    This site is NOT a do-your-homework for you service.
    So to answer your questions...
    brett3120 wrote:
    a) Explain what the code is supposed to do.What do you think that code is supposed to do?
    brett3120 wrote:
    b) Identify any errors in the code.What errors have you identified in that code?
    brett3120 wrote:
    c) If there are errors, please fix them.What fixes do you think you should make?
    brett3120 wrote:
    a) Write a method that can efficiently find out if there is any element in the 2nd list that is an element of the first list.Please post your formatted code showing what you have done to answer this question and please ask a specific question relating to where you are stuck. For example for a compile error identify the problem code, for a runtime error a stacktrace or error message.
    brett3120 wrote:
    b) Describe some of the tradeoffs you can make with regards to memory and complexity.What tradeoffs do you think you can make from the code you wrote in answer to the last question with regards to memory and complexity?

  • Need help with basic Java programming

    I'm having a little bit of trouble with my code. For the sake of argument, I've removed the code I'm having trouble with, because I know it was inaccurate. I'm trying to create a loop so that this program will keep going through and through until the user enters an invalid variable. I thought the default after the case statements was supposed to make the system exit and output my message. Those two problems, the loop and the default, are what I'm really having problems with. My code is posted below.
    import javax.swing.JOptionPane;
    import java.util.Locale;
    import java.text.NumberFormat;
    public class Retail
    public static void main(String args[])
    String firstNum;
    String secondNum;
    String result;
    int prodNum;      //first number to input
    double quantity; //second number to input
    double total = 0.0;     //total of Prod * Quantity Sold for all items
    // To use American Dollar
    NumberFormat moneyFormat = NumberFormat.getCurrencyInstance( Locale.US );
    // first number entered as string
    firstNum = JOptionPane.showInputDialog( "Enter product number 1-5" );
    // second number entered as string
    secondNum = JOptionPane.showInputDialog( " Enter quantity of items sold" );
    // convert values to type double or int from type string
    prodNum = Integer.parseInt( firstNum );
    quantity = Double.parseDouble( secondNum);
    result="";
    if ( prodNum >=1 && prodNum <=5 ) {
    switch (prodNum)
    case 1: // 1st product
    total = 2.98 * quantity;
    break;
    case 2: // 2nd product
    total = 4.50 * quantity;
    break;
    case 3: // 3rd product
    total = 9.98 * quantity;
    break;
    case 4: //4th product
    total = 4.49 * quantity;
    break;
    case 5:
    total = 6.87 * quantity;
    break;
    default: JOptionPane.showMessageDialog( null, "Wrong product number entered" );
    JOptionPane.showMessageDialog( null, moneyFormat.format(total), "Total Price of Items Purchased", JOptionPane.INFORMATION_MESSAGE );
    System.exit(0);
    ***I know I need to put something in the user input message to state that any value other than 1-5 entered will cause the program to skip to the output, I'll put that in later.***

    When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read and prevents accidental markup from array indices like [i].

  • Need Help With NetBeans (Java Studio Enterprise 8)'s code generation

    Hi!
    I am using Java Studio Enterprise 8 with NetBeans 4.1 IDE bundled together with it. When trying to create GUI out from NetBeans Form Designer, I don't like the way it generates the code. When I try to use a JTextField, it uses "Fully Qualifed Class Names" (e.g: javax.swing.JTextField) on the code. How do I set NetBeans not to use it but rather use only the class name and generate import lines on top of the code? Also, how do I set it up that it will generate the variable declarations (which is on the uneditable blue portion of the code) on top rather than the default which is placed at the bottom of the class code body. I have tried tweaking the Options menu of this IDE but haven't got any luck...
    Hope you could help, and thanks in advance!

    To address the location of the var decl codegen section (or any codegen location issues), there is a workaround, admittedly, it is a bit tedious.
    Once the form code is generated, as Kris mentioned, open the class in an external editor so that you can edit the generated code.
    Then cut the entire var declaration section along with the begin/end gen-code markers and paste it to the section of the file you desire.
    When you add more components to your form, the codegen will find this section wherever it is and add to it.
    Alternatively, you could just move the non-protected code around the protected within the NB editor, but you would not be able to rearrange the order of the actual code-genned sections.
    craig

  • Need help with a Java-SQL connection

    My classmates and I created a DesktopFrame. Within it are reports that require a connection to an MS Access Database. When a report in an InternalFrame is opened: the SQL command works, there is a connection, and everything goes well on the first run.
    However, when another InternalFrame is opened or when the same InternalFrame is opened the 2nd time, an error occurs. It produces a java.sql.SQLException: General Error.
    Can anyone help me? Thanks in advance.

    Provide more info, maybe even some code segments. (Not all). May be easier to help

  • Need Help with a Java programming exercise.

    I have to Write a program that reads two times in military format (0900, 1730) and prints the number of hours and minutes between two times. Supply your own test program. Here are two sample runs. User inputs are the numbers.
    Please enter the first time: 0900
    Please enter the second time: 1730
    8 hours 30 minutes
    Please enter the first time: 1730
    Please enter the second time: 0900
    15 hours 30 minutes
    Test Program I can write up myself. But the entire constructor I have no idea how to start. This is basic Java Coding. no C++ no importing anything.
    So far this is what I got and I'm sure it's wrong:
    public class TimeInterval
    private double hours;
    private double minutes;
    public TimeInterval(double Time1, double Time2)
    hours =
    minutes =
    }

    tad2382 wrote:
    Jverd,
    I'm guessing that in your early days on this forum you must have spent a lot of time explaining constructors, object creation, etc. Now, after some 40K posts to the forum, you figure newbies should just go and read the documentation. Is that what a lot of veteran posters feel?Perhaps the OP is not aware of the fact the Sun has a good deal of high quality study material published on their website. What's wrong with posting it in a thread? Why should one copy the same thing over and over again? If after reading that tutorial, the OP still has some questions about it, s/he is free to post a follow up question. I am sure that many of the regulars here are more than happy to answer them.
    Also note that the OP's problem description is rather vague. A "I don't know where to start" is IMO best answered by a link to a comprehensive tutorial or a beginners book.
    Being one of the (relatively) novice posters on the forum, I still feel the need to customize posts,Well, by all means: do so.
    trying to see things from the poster's side. Maybe after a few thousand posts, I'll just keep throwing the same documentation at newbies, instead of detailed customized responses, heh.IMO, that's a load of cr@p.

  • Need Help with a Java Question Plz

    Hi
    Could someone help me out with this please?
    I need to know the difference between the two String methods equals and equalsIgnoreCase
    Thanks

    The former tests if the Strings are equal, the latter tests if they're equal, but ignores case...
    I.e. "A".equalsIgnoreCase("a") returns true, among other things...

  • Needed help with updating java code

    Hello all,
    Let me begin by let you know I am not a programmer and I have tried to solve this by reading on the net. I am a network admin so I tech knowledge but no programming.
    I have a webcam sending a Jpg to an FTP site and there I have used an applet called view.class to refresh once a second.
    site:http://70.154.170.253/webcamold.html
    My problems is now that it refreshes the same image over and over. It refreshes the cached image not the new image.
    From reading I suspect that it has to do with the newer version of java (it used to work fine).
    I have tried using JavaCam but same issue it just refreshes cached image. Also image flickers, the applet I am trying to fix was really smooth.
    I have also tried to compile code that I found on this forum but I got error dealing with deprecated code.
    Any help would be greatly appreciated!!!
    Code:
    import java.applet.Applet;
    import java.awt.*;
    import java.io.PrintStream;
    public class View extends Applet
    implements Runnable
    public void init()
    setBackground(Color.white);
    String s = getParameter("refresh");
    if(s == null)
    update = 30;
    else
    try
    update = Integer.parseInt(s);
    catch(Exception _ex)
    update = 30;
    filename = getParameter("picture");
    if(filename == null)
    System.out.println("No filename given as parameter.");
    md = new MediaTracker(this);
    off = createImage(size().width, size().height);
    refreshImage();
    public void paint(Graphics g)
    g.drawImage(off, 0, 0, this);
    public void update(Graphics g)
    paint(g);
    public void refreshImage()
    img = getImage(getDocumentBase(), filename);
    md.addImage(img, 0);
    try
    md.waitForID(0);
    catch(Exception exception)
    exception.printStackTrace();
    Graphics g = off.getGraphics();
    g.drawImage(img, 0, 0, this);
    img.flush();
    public void run()
    while(th != null)
    try
    refreshImage();
    repaint();
    Thread.sleep(update * 1000);
    catch(Exception exception)
    System.out.println("Error when thread was supposed to sleep: " + exception.getMessage());
    public void start()
    if(th == null)
    th = new Thread(this);
    try
    th.start();
    return;
    catch(Exception exception)
    System.out.println("Couldn't start thread: " + exception.getMessage());
    return;
    } else
    return;
    public void stop()
    if(th != null)
    th.stop();
    th = null;
    public void destroy()
    stop();
    public View()
    update = 30;
    Thread th;
    String filename;
    int update;
    Image img;
    Image off;
    MediaTracker md;

    This is compile error free code and regarding your issues i don't think am good at this stuff
    import java.applet.Applet;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.MediaTracker;
    public class View extends Applet implements Runnable {
         Thread th;
         String filename;
         int update;
         Image img;
         Image off;
         MediaTracker md;
         public void init() {
              setBackground(Color.white);
              String s = getParameter("refresh");
              if (s == null) {
                   update = 30;
              } else {
                   try {
                        update = Integer.parseInt(s);
                   } catch (Exception _ex) {
                        update = 30;
              filename = getParameter("picture");
              if (filename == null) {
                   System.out.println("No filename given as parameter.");
              md = new MediaTracker(this);
              off = createImage(size().width, size().height);
              refreshImage();
         public void paint(Graphics g) {
              g.drawImage(off, 0, 0, this);
         public void update(Graphics g) {
              paint(g);
         public void refreshImage() {
              img = getImage(getDocumentBase(), filename);
              md.addImage(img, 0);
              try {
                   md.waitForID(0);
              } catch (Exception exception) {
                   exception.printStackTrace();
              Graphics g = off.getGraphics();
              g.drawImage(img, 0, 0, this);
              img.flush();
         public void run() {
              while (th != null) {
                   try {
                        refreshImage();
                        repaint();
                        Thread.sleep(update * 1000);
                   } catch (Exception exception) {
                        System.out.println("Error when thread was supposed to sleep: "
                                  + exception.getMessage());
         public void start() {
              if (th == null) {
                   th = new Thread(this);
                   try {
                        th.start();
                        return;
                   } catch (Exception exception) {
                        System.out.println("Couldn't start thread: "
                                  + exception.getMessage());
                   return;
              } else {
                   return;
         public void stop() {
              if (th != null) {
                   th.stop();
                   th = null;
         public void destroy() {
              stop();
         public View() {
              update = 30;
    }

  • Need help with this java thing

    i got a script for virtual keyborad but i don't know much javascript
    so need your help to fit this script to my htmldb application .
    i have page with textare name P2_MESSAGE_DESC
    i put the image near the textarea and i want the textarea to "get" what i type in the keyboard image.
    here is the hava script :
    <SCRIPT language=JavaScript>
    //This var is changed on Unload from talkback to 'false' in order to not generate this onUnload
    var DoUnload = true;
    //var theInputName = opener.document.myform.inputName.value;
    var theInputLength;
    function doInsert(theChar) { 
       opener.document.myform(opener.document.myform.inputName.value).value += theChar;
    function doDelete() {   
      theInputLength = opener.document.myform(opener.document.myform.inputName.value).value.length;       
      if(theInputLength > 0) {   
         if(opener.document.myform(opener.document.myform.inputName.value).value.substring(theInputLength-1,theInputLength)=="\n") {
              opener.document.myform(opener.document.myform.inputName.value).value = opener.document.myform(opener.document.myform.inputName.value).value.substring(0,theInputLength-2);
         } else {
              opener.document.myform(opener.document.myform.inputName.value).value = opener.document.myform(opener.document.myform.inputName.value).value.substring(0,theInputLength-1);
    function doSubmit() {
       //opener.document.myform.submit();
       window.close();
    </SCRIPT>
    <IMG height=159 src="#WORKSPACE_IMAGES#kbd.GIF" width=341 useMap=#HebMap border=0>
    <MAP name=HebMap>
    <AREA shape=RECT coords=272,94,297,120 href="javascript:doInsert('.')">
    <AREA shape=RECT coords=246,94,271,120 href="javascript:doInsert('&#1509;')">
    <AREA shape=RECT coords=220,94,245,120 href="javascript:doInsert('&#1514;')">
    <AREA shape=RECT coords=194,94,219,120 href="javascript:doInsert('&#1510;')">
    <AREA shape=RECT coords=168,94,193,120 href="javascript:doInsert('&#1502;')">
    <AREA shape=RECT coords=142,94,167,120 href="javascript:doInsert('&#1504;')">
    <AREA shape=RECT coords=116,94,141,120 href="javascript:doInsert('&#1492;')">
    <AREA shape=RECT coords=90,94,115,120 href="javascript:doInsert('&#1489;')">
    <AREA shape=RECT coords=64,94,89,120 href="javascript:doInsert('&#1505;')">
    <AREA shape=RECT coords=38,94,63,120 href="javascript:doInsert('&#1494;')">
    <AREA shape=RECT coords=286,67,311,93 href="javascript:doInsert(',')">
    <AREA shape=RECT coords=260,67,285,93 href="javascript:doInsert('&#1507;')">
    <AREA shape=RECT coords=234,67,259,93 href="javascript:doInsert('&#1498;')">
    <AREA shape=RECT coords=208,67,233,93 href="javascript:doInsert('&#1500;')">
    <AREA shape=RECT coords=182,67,207,93 href="javascript:doInsert('&#1495;')">
    <AREA shape=RECT coords=156,67,181,93 href="javascript:doInsert('&#1497;')">
    <AREA shape=RECT coords=130,67,155,93 href="javascript:doInsert('&#1506;')">
    <AREA shape=RECT coords=104,67,129,93 href="javascript:doInsert('&#1499;')">
    <AREA shape=RECT coords=78,67,103,93 href="javascript:doInsert('&#1490;')">
    <AREA shape=RECT coords=52,67,77,93 href="javascript:doInsert('&#1491;')">
    <AREA shape=RECT coords=26,67,51,93 href="javascript:doInsert('&#1513;')">
    <AREA shape=RECT coords=247,40,272,66 href="javascript:doInsert('&#1508;')">
    <AREA shape=RECT coords=221,40,246,66 href="javascript:doInsert('&#1501;')">
    <AREA shape=RECT coords=195,40,220,66 href="javascript:doInsert('&#1503;')">
    <AREA shape=RECT coords=169,40,194,66 href="javascript:doInsert('&#1493;')">
    <AREA shape=RECT coords=143,40,168,66 href="javascript:doInsert('&#1496;')">
    <AREA shape=RECT coords=117,40,142,66 href="javascript:doInsert('&#1488;')">
    <AREA shape=RECT coords=91,40,116,66  href="javascript:doInsert('&#1512;')">
    <AREA shape=RECT coords=65,40,90,66  href="javascript:doInsert('&#1511;')">
    <AREA shape=RECT coords=39,40,64,66 href="javascript:doInsert('\'')">
    <AREA shape=RECT coords=13,40,38,66 href="javascript:doInsert('/')">
    <AREA shape=RECT coords=303,14,328,39 href="javascript:doInsert('0')">
    <AREA shape=RECT coords=277,14,302,39 href="javascript:doInsert('9')">
    <AREA shape=RECT coords=251,14,276,39 href="javascript:doInsert('8')">
    <AREA shape=RECT coords=225,14,250,39 href="javascript:doInsert('7')">
    <AREA shape=RECT coords=199,14,224,39 href="javascript:doInsert('6')">
    <AREA shape=RECT coords=173,14,198,39 href="javascript:doInsert('5')">
    <AREA shape=RECT coords=147,14,172,39 href="javascript:doInsert('4')">
    <AREA shape=RECT coords=121,14,146,39 href="javascript:doInsert('3')">
    <AREA shape=RECT coords=95,14,120,39  href="javascript:doInsert('2')">
    <AREA shape=RECT coords=69,14,94,39   href="javascript:doInsert('1')">
    <AREA shape=RECT coords=13,14,67,39 href="javascript:opener.nextField()">
    <AREA shape=RECT coords=273,40,328,66 href="javascript:doDelete()">
    <AREA shape=RECT coords=78,121,258,147 href="javascript:doInsert(' ')">
    <AREA shape=RECT coords=272,121,327,147 href="javascript:doInsert('\n')">
    </MAP>i just need to figure out the :
    opener.document.myform(opener.document.myform.inputName.value).value += theChar;
    how to change it to my p2_message_desc ?
    thanks

    thanks carl ,
    i changed it to:
    document.getElementById('P2_MESSAGE_DESC').value += theChar;
    and it put me the keyword in the textarea.
    one problem left :-(
    i want it to put the keyword where the cursor is for example
    if i have this sentence in my textarea:
    i love oracle htmldb application
    and cursor is before htmldb word and i enter the word (push the virtual keyboard bottons):
    develope
    the sentence will be:
    i love develope oracle htmldb application .
    now if i do that i'm getting:
    i love oracle htmldb application develope.
    i hope you get my point.
    thanks

  • Need Help with a Java program

    Hey
    I am doing a bachelor of Multimedia and for some reason I was forced to do Programming 1 which is just Java programing.I have been doing pretty well but we have the final exam coming up on Thursday and they told us to learn how to do this question but I have no idea how to do it, could someone please help me?
    Write a program that reads a file containing a list of students' student numbers and names, and then writes out another file in which the students have been formed into project groups.
    Sample input file:
    96439530 Naranek, Kosh
    08532109 Ivanova, Susan
    87642078 Sheridan, John
    44327889 Varner, Dell
    98100023 Kotto, Vir
    66345689 Sinclair, Jeffrey
    77421009 Garibaldi, Michael
    88775544 Winters, Talia
    54321098 Alexander, Lyta
    12345098 Mollari, Londo
    03465499 Takashima, Laurel
    88765432 Kyle, Benjamin
    08876500 Keffer, Warren
    07687878 Cole, Marcus
    For the project course: no group should have more than 5 members; and it is desireable that all groups have as close to 5 members as possible; and that students be allocated to groups alphabetically by family name, as in this sample output file:
    Group 1:
    Lyta Alexander (54321098)
    Susan Ivanova (08532109)
    Benjamin Kyle (88765432)
    John Sheridan (87642078)
    Dell Varner (44327889)
    Group 2:
    Marcus Cole (07687878)
    Warren Keffer (08876500)
    Londo Mollari (12345098)
    Jeffrey Sinclair (66345689)
    Talia Winters (88775544)
    Group 3:
    Michael Garibaldi (77421009)
    Vir Kotto (98100023)
    Kosh Naranek (96439530)
    Laurel Takashima (03465499)
    Students' names are first sorted (Alexander, Cole, Garibaldi, Ivanova, ...), then allocated to the tutes in rotation (Alexander to 1, Cole to 2, Garibaldi to 3, Ivanova to 1, ...).
    Note also that the student's details are written in a different format from the input. You may make the (usually wrong!) assumption that each student has a simple one-word family name and one other name.

    I'm sorry too annoy you again but I don't know how to implement what you told me. Here is my current code:
    import java.io.*;
    import java.util.*;
    class DetailSortTest {
         public void run() {
              try {
                   BufferedReader in = new
                   BufferedReader(new FileReader ("Data.txt"));
                   String line = in.readLine();
                   String[] names = new String [10];
                   int i = 0;
                   PrintWriter FileOut = new
                   PrintWriter(new FileWriter ("Data 2.txt"));
                   processFilesTest(in, FileOut);
                   in.close();
                   FileOut.close();
              } catch (FileNotFoundException f) {
                   System.out.println("Could Not Open The File");
              } catch (IOException i){
                   System.out.println(i.getMessage());
         public void processFilesTest (BufferedReader in, PrintWriter FileOut)
         throws IOException {
              String data[] = new String[100];
              List dList = new ArrayList();
              String NLine = in.readLine();
              FileOut.println(NLine);
         public static void main(String[] args) {
              DetailSortTest anObject = new
              DetailSortTest();
              anObject.run();
    How would I do it I tried:
    NLine.split(data[2]+""+data[1]+""+data[0]);
    But all that displays is null, null, null
    I know I am probably so stupid but I really appreciate the help

  • Need help with a Java applet

    newGame.setActionCommand("newgame:1");
    newGame2.setActionCommand("newgame:2");
    //other lines of code in a previous method, rest of code not shown
    public void actionPerformed(ActionEvent evnt)
    int i;
    int j;
    String sp = new String(":");
    String[] cmd = evnt.getActionCommand().split(sp);
    // rest of code not shown
    // **When I get to that lastline, it tells me that the split() method could not be found in class String.  If you would like to see the rest of my code in order to help me, I will post anything to figure out what this problem is.*//

    "because(sic)" was supposed to be "became" ... anyway, in the API doco, when it says that something is "since 1.4", for example, it means from that point onward. So 1.5.x is good - but I wanted to warn you off v.1.3.x in case that was where you were running this.

Maybe you are looking for

  • Display the Word or html doc  which is stored as blob intable and SearchApplication

    Hi All, I have two doubts and are as follows.... 1)Created a table name create table documents(id number,doc blob); I created a form based on the above table. I have two text boxes on the form, one is to enter the id and the other one is upload the d

  • Clipboard broken in iOS 8

    ok this has been happening since iOS 8 got released, and is still happening with 8.1 It generally begins with copying a link from Safari, either by using the copy button at the bottom of the browser or copying the link directly in the navigation bar.

  • Action forms

    Hi, I've a query reg Struts action form. I want to display a list of registered Users. Here's my UserVO UserVO {   String strFirstName;   List Vehicles; // Ferrari, Lambhorgini }Now, I'll get a List of UserVO from db. How do I create a action form fo

  • URGENT : Where is the Developer Server ?

    I downloaded the trial version of developer/developer server from this site. i installed all the components of the file, and i seem to have the entire developer part. However, i can't seem to find the developer server part. does anybody know how i ca

  • SQL text for cursor

    Hi,   I can see DECLARE_CUSROR < name>  in monSysSQLText but unable to see SQL Test used for declare cursor ? Is there any way to trace it ? I am using ASE 12.5.3 . regards Manoj