• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    That would work ok, and help tp ensure that each batch of new output has been written to the files system.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    You call closeFile in your main method (line 130) regardless of whether it has been used (initialised) or not.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in output of Insert statement(Problem2)

    This looks similar to the problem you posted a week ago (column names not recognised). I see that you have not yet marked that one "solved". Maybe you should fix …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    > because the variable (stringInput) I apply the method to is of type String and not Scanner? Yes If you want to use Scanner methods on data that you have …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Binary search tree not printing in-order

    It's a very common cause of problems for Java learners. The obvious reading of `Thing t;` is that you just created a new Thing. But the language spec defines variables …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Binary search tree not printing in-order

    OK, I get where you are coming from,that Java is not your main language, and thanks for trying to help. But now, for the benfit of any Java learners reading …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in i want to build an app in which server send to messages to each client.

    Yes, definitely. Here's how it works: You start by doing what you can. When you get stuck, or if you want a review of what you have done, we will …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Binary search tree not printing in-order

    The message is saying: Your `iprint` and `preprint` methods have been defined to require a parameter of type `Node1`, but when you call those methods you call them with no …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in StringCharcaterIterator doesnot save characters to an array

    Looks like `marksC` has been declared but not initialised.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help for image add in a cell

    You need to delete the local `table` variable and make sure the real `table` variable is accessible in the ButtonListener class
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    No, especially when writing new code always start off with printStackTrace() everywhere. You never know when the next bug is going reveal itself, and when it does you want all …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help for image add in a cell

    the variable `table` is declared in the listener class but never initialised, so it's null.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help for image add in a cell

    Unless you can tell me the eaxct line where the null pointer exception happened I can't help.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help for image add in a cell

    Why didn't you post that error message with your first post? You have a null pointer (unitialised variable) in your button handler. To diagnose it further we need to know …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help for image add in a cell

    Yes, you said that already. Please explain exactly what is wrong - do you get an error message or exception? What happens when you try to run that code? The …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help for image add in a cell

    That's a lot of code to look through with no idea what you are looking for. Please explain exactly what is wrong - do you get an error message or …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help for image add in a cell

    OK, what eaxctly is your question?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    That looks good now! But please put a printStackTrace() in your exception handlers (especially lines 53 2nd 64) otherwize all you will know is "general error" whereas the stacktrace will …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Multiple choice division problem

    To get a floating point division you have to have one or both of the operands to be floating point *before* you do the division. You can make one or …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Export data from mysql db to csv file using java

    Hi Jordi Please don't hijack old threads - start a new thread for your question JC
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    Yes to both. You can use the system property as you suggest. That's probably what newLine() does anyway. Personally I think newLine() is that little bit clearer when you read …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    Actually my previus description was a bit garbled, and I've now fixed it. Please re-read it. Thanks
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    nextLine reads lines from a file and returns them to you without their terminating \n chars. That's got nothing to do with writing files. The new line character or sequence …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how do you subtract in java

    I'm not a mind reader. You have a problem in a version of your code that you hven't shown. And anyway, I'm not going to read any more of your …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in to calculate the min difference between two splits of a list in #scheme

    DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how do you subtract in java

    Around lines 144-146 you seem confused about what variables you are using.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    That looks like you are writing the new line chars correctly - maybe the poroblem is with whatever you are using to check the contents of the file?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    It looks like you create a new FileWriter for each line in the input (loop starting line 24), all competing to write to the same output and corrupting each other. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application to save word/sentences to file

    In all your catch blocks call printStackTrace() to get full info on the exact error. Use System Properties to get the user's home or working dir, and use that for …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JFrame Calculator

    Thenumbers are normally handled like you are, but when you get an operator you parse and store the previous number then make a note of the operator. Then when the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to read in strings from a file convert to byte code and save in array

    1. Unicode is not a byte code. 2. The web is full of examples of how to read a file 3. That's enough. This is not a free "we do …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to queenofdrama365 in How to read in strings from a file convert to byte code and save in array

    JAVA How to read in strings from a file convert to byte code (unicode) and save in array for hashing? how to use hashing (using list of strings) to find …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in binary trees

    Previous papers are irrelevant. It doesn't matter how many other papers number the root as level 0. In the paper where that statement is made the root is defined as …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java hashing program help

    Excellent. You have demonstrated your ability to copy your assignment (did you get the author's permission?) and paste it here. What do you expect will happen next? DaniWeb Member Rules …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in binary trees

    OK I Googled and found that statement in Adam Drozdek's "Dara Structures and Algorithms in Java" (ditto in C++). BUT BUT BUT earlier in the same para he says "the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in binary trees

    Where exactly did you see the text you quoted in your first post? I agree that it is normal to number the levels starting at 0, but that formula gives …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in rainfall program c#

    Come on now, loop i from 1 to N? That's the simplest, most common type of loop known to man. You have one on line 27 to use as an …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in rainfall program c#

    > what should the vaule of loop years be if i dont know what the user is going to enter I don't understand that question! You have obtained and validated …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in binary trees

    To me it looks like that formula is OK if you number the levels starting a 1, not 0 i level max entries 0 1 2^0 = 1 1 2 …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in rainfall program c#

    Line 23 You are incrementing the final value `Numyears` when you should be incrementing the loop variable `i`
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Creating constructors the easy way in netbeans

    Yes Right click in the editor Insert Code... Constructor... click the fields you want to include as parameters
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Find OOP concepts implemented in a mscaccess database

    Start with the classes. These come from the problem domain, not from the database or the GUI. Your Use Cases will help.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Incorrect output of database program

    Is the capitalisation of the names the same?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Blood Bank Management System please provide some headstart

    jwenting raises some very real questions about the scope of this project. If you want to do this is an OO way, then set the classes aside for the moment …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to divide in java

    > generate random numbers from 1 to 25 and the second random numbers to generate from 2 to 9 and of which the first number must be divisible by the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Blood Bank Management System please provide some headstart

    That seems a decent start. Maybe donor and recipient have enough in common to be subclasses of a Person class? The next step is to take the main use cases …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Converting from one value to another (Java)

    Depending on how fixed the set of values is, you can easily hold the mappings in an external file and read them into a Map at startup, which could be …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Converting from one value to another (Java)

    Is there a pre-defined set of inputs and corresponding outputs? If so a `Map` would be the obvious choice.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to divide in java

    If x is exactly divisible by y then that means x modulo y must be zero (ie the remainder is zero). Java uses the % operator for modulo
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Add JPanel with mousevent

    "didn't work"? Means whay exactly? Error message? Listener not called? Listener called but no panel visible? Panel visible but looks wrong? Come on now, give us some info to work …

The End.