• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Apparently this isn't how to use a SpringLayout

    Anchor RIGHT
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Apparently this isn't how to use a SpringLayout

    For things to be scaled/filled properly you need to specify the weights, otherwize it assumes 0 and groups them all at minimum size in the center.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in enemy intelligence

    That looks like a search. Using the algorithm I posted earlier you can call that recursively based on the previous position until you reach the target square. For simplicity you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Apparently this isn't how to use a SpringLayout

    I've always used GridBagLayout and it's never let me down. What's "not ideal" about it for your application?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Void

    A method can return a value, in which case you specify the type of the returned value in the method header, eg String convertToString() // returns a String but some …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in just need a boost to start

    Please be aware of [DaniWeb member rules](https://www.daniweb.com/community/rules), including "Do not solicit for help by email". DaniWeb is a resource that everyone can contribute to and everybody can use, so please …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in just need a boost to start

    If you have a B.Tech in computer science then you will know how to answer those questions.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in enemy intelligence

    OK, that makes it clear. So, something like if (wants to move right) if (can move right) move right // ideal answer else if (can move up) move up // …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in GUI Input transfer?

    Your model class can have public methods like, for example: void setArg1(double newValue) double getArg1() void setArg2(double newValue) double getArg2() double getResult() so in one GUI you can do stuff …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Should I use a LinkedHashMap for this?

    It doesn't matter! You just need to process and remove entries until there are none left. Any Collection will do. With, I dunno, maybe a dozen entries there is no …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in GUI Input transfer?

    The "standard" answer is to have a "model" class that contains the input data and performs the calculation. You create an instance of the and pass it as a parameter …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Should I use a LinkedHashMap for this?

    Why not just take a copy of the list at startup and remove each program from the copy when its started? When the copy is empty you are done, and …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Should I use a LinkedHashMap for this?

    Iterating any Collection will visit each member once. Do you specifically need to iterate them in the order in which they were created?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Should I use a LinkedHashMap for this?

    What's the requirement for keeping them ordered?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in just need a boost to start

    Hi Aditya Yes, we can help you - but remember that you must make an effort and try. The more you try, the more we will help you. If you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in enemy intelligence

    I didn't answer because I didn't understand the question! Can you explain in english or preudo-code what you are trying to achieve? Eg, why not if (hasToMoveRight) moveRight(); etc?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Learner

    C and C++ are two languages. Java is another, completely different, language. You can't use a Java compiler for C or C++. JDK 1.5 is many years old, no longer …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to detect internet speed of a client from response header ??

    I believe there is not. The best you could do is to send/receive a known quantity of data and see how long it takes. By comparing a small quantity with …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in applet wont run,code perfectly fine

    Maybe if you told us what the "warnings and problems" were then we could help. We're not mind readers.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in What does @Repository mean in spring?

    http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/stereotype/Repository.html
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Is Swift comming to Windows?

    No
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java.net

    Although it is theoretically possible to use Java and .net, in practice it's not feasible. Java comes with its own API that provides a superset of .net-like capsbilities, and is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Pattern Printing

    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 Can't compile Java code with Apache Spark

    Yes, you can use -cp in the javac command instead of setting the classpath. So did you download spark? It's not part of the standard Java distribution. I've never used …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Can't compile Java code with Apache Spark

    Sounds like the jar is not in your classpath. You should have CLASSPATH environment variable, and one of the entries in it should be where the apache jar is stored. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in jtable calendar cell mouselistener

    What exactly is the error message?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Can't compile Java code with Apache Spark

    It would be helpful to know exactly what the error message says.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in eclipse odbc

    Yes, there's no ODBC in current Java. Fortunately there's an open source JDBC Access driver http://ucanaccess.sourceforge.net/site.html that seems to have a good reputation. Ps: That call to Class.forName (line 21) …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in jtable calendar cell mouselistener

    The easiest route into/out of XML is the XMLEncode / XMLDecode classes that are part of the standard Java API. See https://docs.oracle.com/javase/8/docs/api/java/beans/XMLEncoder.html
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Help me please

    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 Java 8 Compilation Error

    I agree. It's an installation problem. Possibly missing files, but more likely some old files that are sitting in the classpath somewhere and masking the Java 8 versions. I would …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in jtable calendar cell mouselistener

    Your problem description is wrong. I ran your code with a print statement in the mouseClicked method as it WAS being called. It's the setBackground that's not working - presumably …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Commission Calculator

    You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful to the many people who give their time to help others …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Multiplying values!

    Whenever the user changes either text box just update the total amount to $5 x (number in box 1) + $10 x (number in box 2)
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in making media player in java by using netbeans

    JavaFX (part of Java 8) has extensive media playing capabilities. Just Google it for tutorials etc.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how can you tell when your calculation is off

    I'm fine. The sun is shining, my wife just bought me a wonderful new guitar, and I'm watching the men's final at Wimbledon. I'm not mad at anybody.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to add a different object type into an ArrayList

    It's exactly the same problem as above. You can't add a Product to a list of Orders. You have to create a new Order and add that.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to add a different object type into an ArrayList

    I don't have the code for the Order class, but I guess it may have a constructor that takes a Product and a quantity or something like that? Anyway, if …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how can you tell when your calculation is off

    Hi - you didn't upset me, so don't worry. I can't see any code there that calculates a value for `gpay`, so its value remains at 0. Similarly for `netpay` …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to add a different object type into an ArrayList

    What??? Why did you do that? Is Product *a kind of* Order? If not, it should not be a subclass. The question is: what were you trying to do when …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Inheritance issue

    1. Is SphericalCoordinate *a kind of* PolarCoordinate? If not, it shouldn't be a subclass. EndOf. 2. Are there situations where you will use or accept a PolarCoordinate without worrying about …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to add a different object type into an ArrayList

    `orders` is an arraylist of `Orders`, so (unless `Product` is a subclass of `Order`) you can't add a `Product` to it.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in inheritance class hierarchy

    You don't change what the dimensions are called, you just take a value for `side` and use it to set both dimensions to the same value.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Odometer

    `first` is a variable, not a class, and it *is* defined, so that's not the problem. Read the error message: cannot find symbol ... method setMPG(double) it tries to call …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Difference b/w ++variable and variable++ in loop

    I think this is an old micro-optimisation thing that is irrelevant with modern compilers. The preincrement just adds 1 but the postincrement theoretically requires you to store the initial value …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Problem calling a method from main

    OK, let's think about it... What's different between any two "buy product" processes? Only the user. So we can code it as a method with just one parameter... `void buyProductFor(User …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Problem calling a method from main

    That will just loop forever calling itself. You have to read that tutorial properly. In pseudo code the equals method is going to contain some logic like`: if (the other's …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in why the output is not showing while showing no error?

    There's no code there that displays anything. You have not written any code to display any output. So there is no output. You forgot to write print statements such as …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Problem calling a method from main

    No no no. That was just a way of explaining how `contains` works. It needs to be able to test if any user in the list is the same as …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Problem calling a method from main

    The loop (line 1) is totally wrong. First time thru the loop you add the user Second time thru the loop the user is already in users, so you take …

The End.