• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Array doubles

    `Integer.parseInt(...` takes the string that the user entered and converts it to an int. You can put that into an array of doubles, but you will have lost everything after …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Can't see why I'm getting this error

    You are using + to concatenate stuff for printing, OK, but you have left some out. You need a + between every expression.. "there are " + weeks + " …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JDatepicker

    Just Google - there are tutorials on thr web.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Executable jar with images and a database

    I don't know which database you are using, but JavaDB/Derby can run as an "embedded" database or a server. If it's a server you have to install and start it, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to count the number of days from January 1, 0000 to any given date

    (year % 100 != 0) && (year % 400 == 0 ) something wrong there... if (year % 100 != 0) then (year % 400 cannot be == 0 ) …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Removing the first line in JTextPane

    Despite your unwillingness to supply all the relevant info, I'll give you this as a present: the remove method does NOT take two offsets as parameters. Check the api doc …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Removing the first line in JTextPane

    You need to post the exact complete output from the printStackTrace().
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in null pointer error

    ? Splitting the declaration onto 3 lines will have zero effect. This is not a "null" problem, it's an undefined symbol. The problem is that the Preference class is not …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help in Inheritance

    Yes, that code looks like a good answer to the question. (Except: Spelling mistake on line 1, and I have not tested it on a computer). ps: Most people here …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Deque program project

    DEQue = double-ended-queue. You can add and remove items from both ends. Eg http://docs.oracle.com/javase/8/docs/api/java/util/Deque.html You can implement it using an array or a linked list (maybe other ways as well), …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help in Inheritance

    You must try to answer this question. Show us your answer and we will help you to get it right.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Deque program project

    What help you need?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Removing the first line in JTextPane

    It's not enough to tell us "I got an exception". You need to post the exact complete output from the printStackTrace().
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Removing the first line in JTextPane

    How many times have we said this in the Java forum... Never NEVER *NEVER* do this when writing new code: } catch (Exception e) { } If/when there is an …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Problem with final output

    OK, but just for your information, the array would work something like this: instead of Cat cat1, cat2, cat3 you have Cat[] cats = new Cat[3]; then the three Cats …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Removing the first line in JTextPane

    I don't know, but you could try printing the contents of firstLine to see what's happening. Maybe it's something that's not displayed, like "<html>" ???
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Problem with final output

    Lines 43-51 you set the same data for all 3 cats, using the data from the third/last pass of you input loop, so when you print them of course you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Marked Solved Status for Problem with final output

    Greetings, I'm having problems with my output. Essentially I am just trying to print out any Cat who is over 3 years old and has Claws. But my output keeps …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Guessing Game

    Line 64 is where the loop in question starts, so that would be a bad place to break. Your loop runs 7 times, even if the user guesses correctly. YOU …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Guessing Game

    You may wany to `break` out of the loop (line 64) when the user has the right answer
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Guessing Game

    The thing that immediately jumps out is that on line 44 you comment *end of for loop*, but theres no closing bracket to implement that, so the for loop is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Executable jar with images and a database

    OK You don't need NetBeans to run a Java program, but you will need a standard Java JRE on each user machine. To make a jar just follow the instructions …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Executable jar with images and a database

    So what is it about making your jar that you need help with... How to make a jar in NetBeans? How to embed images in a jar? How to embed …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Extract Data from a webpage

    YOU can use Java Sockets to connect to a web site, send an HTLM request, and read the response. The hard part is usually parsing the web page to extract …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java project-compueting class marks

    Nobody will send you the code. Sending you the code will only help you to cheat. Either do the work or drop the class. If you want to take this …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in need help

    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

    Gave Reputation to djjeavons in If condition has to be changed from Numeric to alpha Numeric

    Hi Rather than changing the isInteger method (which may be used elsewhere), if you want to allow alphanumeric characters, just remove the isInteger check in your code: if (vic.value.length != …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in If condition has to be changed from Numeric to alpha Numeric

    The check is obviously done in your isInteger method, so you need to change that. Edit: djjeavons makes a good point. My advice above is bad. Don't change isInteger - …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to make teamviewer

    Sorry, I don't have any other info - that's one reason why we ended up developing our own algorithm. Briefly: We send the screen image as a series of 32 …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Help me out solving this Java Program

    I suggest you post this in the Java forum, but first check the DaniWeb Member Rules and "provide evidence of having done some work yourself if posting questions from school …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to make teamviewer

    Sending mouse and keyboard events depends on the language you use, but the real problem is how to send and update the real-time screen image across a limited bandwith. It …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in what can I do to make this program read all of the condition

    The problem isn't how you set `exmile` and `retmile`. The problem is that you do the if tests with a third variable called `mileage`, but you don't set that variable …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in convert array of type short to array of bytes

    You posted someone else's code without permission, in violation of the Member Rules. I am not advising you, I am warning you. Write yor own code, and post that.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in what can I do to make this program read all of the condition

    You input two mileage figures (`exmile`, `retmile`), but your if tests use `mileage`, which you never set. Typically you would have a do....while loop that keeps processing user input until …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to lena1990 in convert array of type short to array of bytes

    here is the code toconvert array of short to array of byte byte [] ShortToByte_Twiddle_Method(short [] input) { int short_index, byte_index; int iterations = input.length; byte [] buffer = new …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in convert array of type short to array of bytes

    Instead of copying code from the web and implying that it's yours, why not try writing some code yourself. ps DaniWeb Member Rules include: Do ensure you own the intellectual …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to write a java object -oriented program

    I'm fine thanks. Don't worry if you have periods of frustration, or even despair. It happens to everyone. Learning a full programming environment like Java is never going to be …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to write a java object -oriented program

    There's no one absolute definition of "Object Oriented", so different people will give diferent answers to those questions. Here are my first attempts: All Java OO programs are Java programs …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in An Android Application

    That's his opinion - my opinion is opposite. The "resource deprived hardware" phones he talks about have more memory and compute power than the mainframes I learned on. Every new …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in storing passwords, keys, etc

    [This web page ](https://crackstation.net/hashing-security.htm)has an excellent discussion of how to do it (and how not to do it)
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in can somebody explain these codes to me

    It's creating a grid to display one month's calendar, one week per row x 7 columns. It loops through all the days, divides by 7 to get the week (row), …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Write a function to swap two values using pointers

    After 5 years either he will have got the answer or have given up. Please don't re-awaken old dead threads without a good reason.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in A little basic Java loop help?

    boolean isAnExample; ... do { // Loop until user enters a valid password isAnExample = true; // re-sets boolean at start of each pass of the loop ...
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in A little basic Java loop help?

    You obviously need to re-initialise your booleans each time the user enters a new password (ie around lines 19 to 31)
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Connecting Data base to java

    http://docs.oracle.com/javase/tutorial/jdbc/index.html
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in deleting the first line from text file

    You seem to be ignoring the end-of-line char(s). What did you intend wih the two calls to readLine?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in GUI Programming

    I don't have a retina mac here, so I can't do that right now, but what you would see is that your window, and any contents that you specified in …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in GUI Programming

    In my mind this is a complete show-stopper question. Ordinary monitors used to be 72 dpi, 90-110 is more common now, retina MacBook is 227 dpi. The latest 27" iMac …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in GUI Programming

    Since you mention Mac OSX... Your sizes and positions seem to be in pixels(?). How do you deal with the difference between "retina" displays and older ones with pixels more …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Using Delimiters to extract multiple characters

    Yes, that's much better! ps line 37 `e.printStackTrace();` gives you more information about any error than just a `println(e)`

The End.