• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in The Width of the Windows

    Either Use an inner loop that prints the correct number of asterisks or blanks for each window or Have a long-enough string initialised to lots of asterisks and print a …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Question about Socket/ObjectOutputStream Error

    The client code above reads a single byte array from the socket then closes the socket. Obviously that's not going to read multiple objects! Is there some other code you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in eclipse taking too long to open

    Howmuch memory does your PC have? How much is free before you start Eclipse?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Development Methodology

    I'm a huge fan of Scrum http://en.wikipedia.org/wiki/Scrum_%28software_development%29 It's the exact opposite of the useless waterfall approach. It's one of the original Agile class of methodologies. I worked for Jeff Sutherland …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in creating objects and save them to a text file..

    The compiler is your friend. If you compile this code the error messages wil show you some things to fix. In the meantime, here are some points: You create Person …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Blue passenger train help

    OK, that's ok. If there is anything you still want to verify or discuss please feel free to ask.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Ascend/Descend

    Once you have the array sorted ascending then you get the descending order by simply starting with the last element and working all the way back to the first. Ie, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in run jar

    > SomeClass.main(null) or something like that... Yes. That was the other solution I had in mind too, especially if he wants to interact with the classes in the jar directly. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in run jar

    In that case you can use the `ProcessBuilder` class - it lets you start an external process, set its working directory etc. See the usual API doc, or Google for …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Passing an array between classes

    What you suggest is what I would do too. I was pitching my response a beginner level, hoping to avoid something like this, which would leave him in the same …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Login

    There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java

    What is your question?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in run jar

    Do you simply want to start the application in that jar executing, or do you want to use the classes inside that jar?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Passing an array between classes

    stultuiske's comments are correct, but his solution doesn't quite apply to your case. His advice is correct for printing an instance of a class you define, but not for printing …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Groovy regulat expressoin

    ... and if not maybe someone has some ideas about how to write one? That would be a really ace project.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Confused Java Learner

    Hi Xabush. Welcome to Daniweb. I'm not going to join in any sematic debate about "intermediate", but I will refer you to the top sticky in this forum, which is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I create a pair of longitude and latitudes to show a 2 mile radius o

    Maybe a misunderstanding? This is a forum where people can come for help with their Java code. It's not a free coding service. I posted some formulae and algorithms that …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I create a pair of longitude and latitudes to show a 2 mile radius o

    ^ that's what I thought too, and I asked him if he had any circle-drawing methods available, but his answer is perfectly clear: "*by means of a polygon parameter expressed …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I create a pair of longitude and latitudes to show a 2 mile radius o

    You can generate a set of x,y distances to define n points on the circle relative to its center using x=sin(a), y= cos(a) for n values of a between 0 …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I create a pair of longitude and latitudes to show a 2 mile radius o

    You need to decide how "smooth" you want your circle to be if you are approximating it by a polygon. Three points is the minimum to define a 2D area, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I create a pair of longitude and latitudes to show a 2 mile radius o

    So that's any three points on the circle? Eg 2 miles North, 2 miles South 2 miles East of the location?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in To display retrieved image from oracle database using java

    ^ yes. Whatever encoding is used to convert the blob to an Image must be the inverse of whatever encoding was used to create the blob in the fist place. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Address Book

    Welcome to DaniWeb! People here will be happy to help you - but you'll get the best value from that if you ask specific questions. Looking at your code there …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in To display retrieved image from oracle database using java

    Your second line creates a byte array of the right size, but you do not copy the data from the blob into that array, so the array is just full …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application Doesn't Terminate In Eclipse On Close

    One that's declared in the class, but not inside the definition of any method or constructor, and isn't static.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How do I create a pair of longitude and latitudes to show a 2 mile radius o

    I'm no expert, but maybe this will help: There's a simple formula for the distance between two long/lat points (Google!). You can rearrange that that to make the distance fixed …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Application Doesn't Terminate In Eclipse On Close

    That's just a restriction on inner class binding to local variables (just ask if you want he full explanation). Simply make your timer variable an ordinary instance variable and the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Sort a text file into an object class in descending order

    There's a lot of very tangled code there, so maybe best to start again and go one step at a time. First, you need to read the file and create …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Add item to combobox

    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 reading int from file start from number 2

    Your file name looks wrong - too many back-slashes. YOu only need two backslashes in your String literal to represent a single backslash in the file path
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in error: cannot find symbol - I do not see where I am wrong

    Line 10 - the method name is spelled differently
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Most Repeated char in a String

    Not in the standard API, no. May I guess that you have been set this as an exercise?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JavaFX Label setText NullPointer

    Yes, there's no reason for Swing Timer when you're using JavaFX, so your solution is correct. There must be a JavaFX equivalent to `javax.swing.timer`, maybe `AnimationTimer` or maybe `Timeline` ??
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JavaFX Label setText NullPointer

    `start` returns when it has executed all the code you put in it. It's `Application.launch` that never returns. Where exactly did you put the code to start the Timer? Did …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JavaFX Label setText NullPointer

    You still have exactly the same problems I described in my previous post: tick() contains an infinite loop that just runs at 100% CPU usage start() never finishes because it …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JavaFX Label setText NullPointer

    Maybe because you never finish the start method? (It calls tick() which never returns). Anyway, that while loop in tick() looks very wrong to me - depending on what update() …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Memory Allocation on Object Creation

    Classes and instances are all allocated on a JVM heap. Parameters and local variables in methods are allocated on the stack.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JavaFX Label setText NullPointer

    That's why its better to `System.out.println("controller: " + controller);` etc! I just did a little test case, running from a main that starts with an Application.launch(...) and, just like it …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JavaFX Label setText NullPointer

    *Maybe* that code is running off the Application.launch - before you initialise the game variable? <update> Javadoc for launch... > public static void launch(java.lang.String... args) > > Launch a standalone …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Memory Allocation on Object Creation

    Beuase all the methods are the same, there's just one copy in memory. That's loaded when the class is loaded ie sometime before you first use it. The same is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in mysql search in java

    Hello Sardar. Welcome to DaniWeb. Please take a few minutes to familiarise yourself with DaniWeb Memnber Rules before posting. eg "Do ensure that all posts contain relevant content and substance …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Cache using Java Maps. Clearing unwanted entries

    Why not just a scheduled clean-up that uses `map.remove(key)` to remove unwanted entries?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JavaFX Label setText NullPointer

    Standard procedure: print all the variables at that line to see which one is null. It could be controller, controller.totalGoldLabel, game, or the returned value from game.getTotalGold()
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JFrame.DISPOSE_ON_CLOSE

    Somewhere you have some code that creates the JFrame - somewhere in there you need a mainPanel = (your new JPanel) - without seeing the code I can't be more …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in multithreading in parallel in java

    You just created a new topic with exactly the same question and exectly the same error. If you persist in ignoring the DaniWeb rules you will get infracted - possibly …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JFrame.DISPOSE_ON_CLOSE

    Becuase the JFrame disposes correctly the first time, that shows the mainPanel variable correctly refers to that JPanel. Then you create a new JFrame for the second user, but the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JFrame.DISPOSE_ON_CLOSE

    You really haven't posted enough code to show where the problem lies, but from those two lines here's a guess... are you sure you are updating the mainPanel variable when …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in multithreading in parallel in java

    You started a new thread for no apparent reason, and without marking this solved - we'll continue the discussion here. Please read my previous post. Your latest code makes exactly …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Problem when accessing applet and oracle forms(runs in jinitiator)

    This is from WikiPedia... > In 2007 Oracle announced, that for the upcoming release of Forms version 11, Jinitiator would no longer be needed and that users should migrate to …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to create jar file in java?

    If you Googled you would very quickly find the Oracle tutorial: http://docs.oracle.com/javase/tutorial/deployment/jar/index.html but if you are using NetBeans or Eclipse then both those IDEs have their own tools to simplify …

The End.