• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Could you please help me fix my game of life code?

    For the game of life you have to check the number of adjacent cells etc over the whole board, and then update the cells as appropriate. What you are doing …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Bluej Music player

    19: The Track class does not have a constructor with no args. 58: you are trying to assign an int to a Track object - obviously not possible 66,77: you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in program showing blank JFrame calculator

    ^ That's right. Also, mixing layout managers with setBounds is a recipe for chaos. And you haven't needed to use `frame.getContentPane().add(stuff);`for about 10 years. You can just use `frame.add(stuff);`, or …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to write from one file to another

    You must be more careful about confusing `write` and `print` methods like that (lines 32, 34). `public void write(int c) ` Writes a single character (whose UniCode value is in …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to write from one file to another

    > print throws an exception because there is no print method ??? `PrintWriter` has 9 overloaded `print` methods- one for each of the primitives plus ones for Object and String …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I test all of my methods given the code I have?

    > what do I need to put in between the four operations to make it work? That's your homework for you to do. I'll help you if you're stuck, but …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I test all of my methods given the code I have?

    That's good advice. I was ignoring your syntax errors because (a) the question was about how to test and (b) you would discover them yourself as soon as you tried …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to AssertNull in How do I test all of my methods given the code I have?

    public Student(name, ID, GPA){ this.name= name; this.id= ID; this.gpa=GPA; } This doesn't compile. Learn to crawl before trying to walk. Java requires you to explicitly declare the types of parameters …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I test all of my methods given the code I have?

    Yes, you do need to create objects before you can perform operations on them. Where to create them? Not in the Student class. The whole idea is that Student is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I test all of my methods given the code I have?

    > when I create a StudentLisitng will I only have showAll(), insert, delete, update, and fetch methods just in that class? Yes > I wouldn't have to add the fields …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java array

    How far have you got? What exactly are you stuck on?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java runtime error

    90% probability that it's just looking in the wrong place. You can try `System.out.println(new File("file.txt").getAbsolutePath());` to see exactly where Java is expecting to find it. ps this is a good …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I test all of my methods given the code I have?

    That's right, except that StudentList does NOT extend Student. The `extends` relationship means "is a kind of" as in `Cat extends Mammal` means Cat is kind of Mammal. A student …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I test all of my methods given the code I have?

    There seems to be a fundamental problem with this code. There are two kinds of things in the application, students, and a student listing. You have tried to use the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How hard it is to learn Java or PHP?

    The basics of the Java language - weeks Advanced Java language - months The Java API library - years.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in NullPointerException in table

    `mainApp.getPartsData().add(selectedPart);` If that line throws an NPE then either mainApp is null getPartsData is returning null. A quick print (or use a debugger) wil quickly show which and thus show …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Shifting graphics lines left/right

    Thanks for that - it's similar to mine, but better in that it fits to the node circles better. Great. DaniWeb (what remains of it) still rules! Thanks again JC
  • Member Avatar for JamesCherrill
    JamesCherrill

    Marked Solved Status for Shifting graphics lines left/right

    Hi Guys. This is a seemingly simple problem that's got me stuck, so I'd be very grateful for any ideas you can offer. I'm working on a program that has …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Shifting graphics lines left/right

    Eureka time... Looking at my cheated version I noticed that the factors I was using (1, 0, .7) corresponded to the sin and cos of the line's angle, so from …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Shifting graphics lines left/right

    That was just some test data from the WIP, and there are situations where the nodes are linked just one way. But anyway, that's still the same question: the Nodes' …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Shifting graphics lines left/right

    Yes, I see what you are doing there, but will be using color coding for the status of each link, so the forward link may be OK (green) but the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Shared Shifting graphics lines left/right

    Hi Guys. This is a seemingly simple problem that's got me stuck, so I'd be very grateful for any ideas you can offer. I'm working on a program that has …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Shifting graphics lines left/right

    Well, cheating is always an option! Right now I have just implemented (just a couple of minutes ago) a cheat... if line is near vertical, shift right if its going …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Shifting graphics lines left/right

    Just as easy to describe I think... imagine a straight line going in some direction. I want to move that line a few pixels to its right (as seen when …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Shifting graphics lines left/right

    Yes, thanks. Java has something similar, but the unanswered question is how to determine the correct offset to use. I'm thinking I may be able to fudge it by hard-coding …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Created Shifting graphics lines left/right

    Hi Guys. This is a seemingly simple problem that's got me stuck, so I'd be very grateful for any ideas you can offer. I'm working on a program that has …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java loop

    Your code is almost almost there... Here's a simple way to structure it (pseudo code) ask for number of students for n = 1 to number of students { ask …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Question about mutator/accessor methods in Java?

    `bookVersion = pub.setVersion(bookVersion);` your `set` methods are void, so they don't return anything, so there's nothing that can be assigned to `bookVersion`. It's traditional for `set` methods to be void, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in software

    Hello Shiv. Welcome to DaniWeb. Your help will be very welcome.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Is this book <JAVA in a netshell> good for beginners?

    I had a quick look at this and it's pretty simplistic (and out of date) stuff. Why would anyone think it's a good idea to waste time writing tutorials when …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Finding the "missing link" in a maze solving lab

    > I've found the current problem to be with the second run That's a very common problem. Trying to re-use existing objects and data structures for new run ... it's …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Error in setValueAt JTable Java

    If `quantity` is not 1 the you don't set `rows` properly and it's left at 0 (only done on line 9). If you are trying to update the last row …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Error in setValueAt JTable Java

    If `quantity` is 1 then you add a new row, and do not execute line 12. For other quantity values you execute line 12 with the second parameter invalid (see …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Error in setValueAt JTable Java

    I don't know your design, so I don't know wha the "specific row" is. What I can say is that if `rows` is (eg) 2, then the valid values for …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Error in setValueAt JTable Java

    Just a guess: Its line 12 that's the problem. `rows` is the number of rows, so valid values for the second parameter should be 0 to (rows-1)
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Finding the "missing link" in a maze solving lab

    rproffitt: Sorry, but it does look to me like you have missed Gorge's point. He has got a working algorithm, but has a specific problem with intersections that have 4 …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Random Sentence Generator

    OK. I removed the Java tag as well. JC
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Random Sentence Generator

    Where's the Java?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Select shape/s with drawing rectangle around it

    `Rectangle` is a `Shape`. All `Shape`s implement `getBounds()`
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Select shape/s with drawing rectangle around it

    First, selecting a shape by clicking inside it... the `contains` method comes from `Shape`, so assuming you have some kind of list of the existing shapes you can iterate through …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to use WHERE and LIKE with a variable

    Another observation is that firstname is so far from unique that it's completely useless on its own as a key. Just wait until you have 100k users and you search …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to cereal in Checking For a Solution

    > Seen that message many times, never seen a solution. Seen that message many times, never seen a solution.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Checking For a Solution

    Seen that message many times, never seen a solution.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to add quantity in an existing record in vb.net using datagridview

    That's a very general question. Please be more specific and *show what you have done so far*.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Edited how to add quantity in an existing record in vb.net using datagridview

    how to add quantity in an existing record in vb.net using datagridview
  • Member Avatar for JamesCherrill
    JamesCherrill

    Edited a c++ program which lets me change the password

    hello i am a newbi c++ user.it will be great if someone can help me write a password protected program for multiple user where the user can change the password …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Applets with JOptionPane(Help!!!)

    Hi Darren Please start your own new thread for your question - do not hijack other people's old threads. Don't forget to ask clearly what help you need, and show …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How To Make Dani Web The Best Forum That Attracts Newbies & Earns Oldbies!

    > rproffitt: Would be a nice feature (an ignore list.) > gentlemedia: Yes, a block member would be a great addition > happygeek: Agree. Shame there isn't an equivalent to …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in on undo button press delete last shape

    I would not put the code lines 4-8 in paintComponent. They don't belong there, and don't forget that paintComponent may be called by Swing at any time. I would just …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Trying to contact Dani

    > Who's UI? Don't worry - it's a bit of an ongoing in-joke here at the moment. I've sent Dani a PM on your behalf to let her know you …

The End.