• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Having trouble sorting my array in ABC order

    No (unless you want to keep the original order as well). Arrays.sort will just sort the existing array according to your comparator. It doesn't create a new array.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Having trouble sorting my array in ABC order

    Yes. Anyway, rather than blindly copying some random code from the web, learn how to sort arrays of objects and write it yourself. The key to sorting objects is a …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to store each newly created account into an array of Customers?

    What is your question, exactly?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Having trouble sorting my array in ABC order

    Let me re-phrase that... The code starting at line 173 is not Java code.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Exception width and height can not be <0

    It's line 152 (new BugfferedImage) that's going wrong - implying tha there's a problem with the ImageIcon/Image that you use to get the width & height. Try printing the ImageIcon …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Having trouble sorting my array in ABC order

    Line 173 etc... is that Java?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Need some help with starting a program...

    Disagree. Never start with the GUI; always get the model first. Anyway - who said this was a GUI application? Vardaan: DaniWeb Member Rules (which you agreed to when you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Update objects on the "Client side" from the "Server"

    Unless the server's model is very large it's easier just to send a copy of the whole model as a single object. (If you don't have a top-level object that …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in arraycopy();

    It copies two elements starting with element 2 (NB: zero-based) to positions starting at 3. Ie it copies the values in indexes 2 and 3 (values 3 and 4) to …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Update objects on the "Client side" from the "Server"

    Please review the answer I gave earlier about how the client and server interact - no need for a controller. The client connects to the server and waits for update …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Exceptions and Printwriter

    The requirement seems incomplete to me, but I think it means: read an array of 100 numbers from a named file then read numbers from stdin. If each number matches, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JAVA Help plzzz

    See reply to post 3
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help java hw plzzzzz :'(

    See reply to post 3
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help java hw plzzzzz :'(

    Time to face reality. You have (at least) 4 homeworks due tomorrow, and you haven't done anything. That's nobody's problem but yours. You will get all the help you deserve …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Cannot find symbol in for my method.

    Please don't be offended - it's nothing personal. People here are more inclined to be forthright than polite for polite' sake. It's the information content that counts. :) Using `= …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Cannot find symbol in for my method.

    How can I make this clearer? Testing a boolen expression to see if it's true by using `== true` is stupid. A boolean expression (like your isValidVowel method call) is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Cannot find symbol in for my method.

    You defined the static method in a different class, so you need to specify that class when you call the method, ie IsVowel.isValidVowel(letter) Also, it's utterly pointless to add `==true` …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Cannot find symbol in for my method.

    Oh dear, I'm almost as embarassed pointing this out as you will be... Your method is called `isValidVowel`, but you try to call a method called `isVowel`. Sorry J
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Client/Server

    I wasn't familar with bcrypt (until now), so, yes, I agree with ~s.o.s~ - don't write code if you can use properly designed and tested pre-existing code.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Client/Server

    [This web site](https://crackstation.net/hashing-security.htm) has an excellent article on how to store passwords (and how not to, and why). There's nothing I can add to what it says.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Client/Server

    I wasn't suggesting a "second server" as a separate program necessarily. I was just making the logical distinction between the two types of "serving" that are going on. I see …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationExcept

    What version of Java are you using. What is the O.S.?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Client/Server

    There's no way the client should be starting or stopping the server that is handling the communications with the client! Maybe your problem comes from confusing the server that talks …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Timing Execution in Java for Bucket Sort

    The System class has methods to get the current time. There's a nanosecond version as well, but your pc may not be able to supply such precise time. Just get …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Client/Server

    Like I said, RMI will do it, but it's hard Writing your own little command handler is much easier.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Client/Server

    Java RMI would do that. It provides a version of the server's interface at the client end. Have a look at it, but be aware that it's pretty complicated and …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Ball game

    Wrong use of += and-= lines 112, 116 Should be dx = -dx; in both cases Sorry short answer, just on iPhone
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Ball game

    If it can only approach the wall from one side, then a simple test of the sprite's x value (for a vertical wall) is enough. Something like: if (sprite.x >= …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in A java swings program on shapes

    You can't draw things in Swing by just drawing to some random Graphics. You have to fit your drawing into the existing Swing mechanisms. [This tutorial](http://docs.oracle.com/javase/tutorial/uiswing/painting/index.html) explains what you need …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java GUI calculator event handling problem

    You only do the calculation if counter == 1 Look where you declared counter. What is its scope? What will the value of counter be every time you enter the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java GUI calculator event handling problem

    > i am waiting?????????????????? Rudeness will not get you any quicker answers. Please feel free to wait until you decide to be polite.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to moaz.amin.37 in java GUI calculator event handling problem

    i am waiting??????????????????
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in arrays

    Sorry, nobody is interested in answering your little puzzle. Do you have a Java topic we can help with?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Data Structures and Algorithm

    What exactly do you expect anyone to do with that information? Did you have the owner's permission to reproduce that complete document on the web? Have you read the [DaniWeb …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in InputMismatchException stops input

    The problem is that you throw the exception from the setScores method, which doesn't allow you to recover or continue after the exception. Data format errors are best handled inside …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in problems in printing receipts using arraylist in java

    That's a lot better, but you still have line 11 wrong - where's the NOT?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in problems in printing receipts using arraylist in java

    Don't hijack `toString()` for a specific problem like this. Save it for a complete description of the Item object. `getName()` would be better. `equals(newItem)` isn't going to help unless you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to zolymo in For Loop

    it maybe cant be out for the loop, because you have for (int numberOfScores; numberOfScores > 0; JOptionPane.showInputDialog("Enter Score")){ //... } this is an example for(int numberOfScores; numberOfScores > 0; …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in For Loop

    If you have a compiler or runtime error message post the complete message plus the actual code it refers to. If your code is giving an incorrect result explain what …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in can somebody tell me where my error are

    if(user_name<22) user_name is a String so you can't compare it to a number like that. Maybe you ahould be comparing the user's age, not their name?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Ball game

    [This thread](https://www.daniweb.com/software-development/java/threads/450954/getbounds) ends with a sample program I wrote to demo the best simple way to animate multiple things moving around the window. It also discusses collisions, which will probably …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java ByteCode? What is it used for and how can I learn it?

    In real life nobody codes applications in bytecode. If you can't do something in Java then its very unlikely that you could do it in bytecode. Unless you plan a …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in pls Which is the suitable java version for creating Mobile apps

    Which mobile operating system?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Ball game

    The message tells you the error is on line 200 - `y=rt.getTopY()-diameter;` - null pointer means uninitialised variable, or a method returned a null that you then tried to use. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in problems in printing receipts using arraylist in java

    When you are entering the item names etc, check to see if there is already an item in the ArrayList with that name and price. If there is, add the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to hide jframe using thread

    Just call `setVisible(false)` or `dispose()` on your JFrame. It's the same regardless of what you are doing with threads or timers. What's your real question - do you want to …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java program

    and the code that creates `nf` is...?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in A Head Start to Java?

    If you want comprehensive, then Oracle's own tutorial pages are the definitive source, very complete and totally up-to-date. Start [here](http://docs.oracle.com/javase/tutorial/reallybigindex.html).
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Implementing a move method for the Earth

    What graphics are you using - Swing?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Student Ranking

    In the sort, instead of swapping names and gpas, just swap the two Student objects. That's easier, and it won't break when you add another field, eg date of birth, …

The End.