• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in multithreading in parallel in java

    Looks like a problem in your use of Random for the sleeps - you cast the floating point random number to an integer (therefore always zero) *before* multiplying it by …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in multithreading in parallel in java

    That all looks like good progress to me. There may still be mistakes (I didn't study every line) but what you are doing with the constrcutor and passing the values …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 10,000 posts

    ... and of course Dani, whithout whose imagination and hard work none of this would have been possible. [is that OK, do I keep my moderator badge now?]
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 10,000 posts

    Sorry, that was 10,000 in the Java forum - currently 10101 in all forums (fora?). In fact, I like 10101 better as a number....
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in read seq. string & merge

    > It reads a sequence of strings, each on a separate line, and stores them in an array, let call it input1, with one string per cell, in the order …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Inserting a char in a LinkedList

    The loop on line 17 looks suspicious. Why not loop all the way down the list? Line 15; what's the initial value of *game*?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Finding it hard to understand wrapper classes

    Here are some *simplified* answers to start with - you may want some follow-up questions. A class is a data type - think of it as a struct plus some …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 10,000 posts

    I thnk you are too modest about your knowledge of Swing. It doesn't metter where you got it - it's still amazing. > whats said your woman for your effort …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in write java code for ILOG

    I'm sure there are people here who can help. *Exactly* what help do you need?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JavaFX The Constructor PerspectiveCamera(boolean) is Undefined.

    You are looking at docs for JDK/JavaFX version 8, but using a version 7 implementation. There are many changes and enhancements in 8. You can download a "developer preview" of …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Created 10,000 posts

    This is my 10,000th post in the DaniWeb Java forum. so I hope I won't get an infraction for being off-topic. I just thought this would be the perfect opportunity …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in multithreading in parallel in java

    Something like that... But your names and nums are in two array lists, so you need to pass the elements of those lists to each constructor
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 'Overlayed' Panel/ Docked Panel.

    Annoying? Absolutely not! Sensible questions, and good use made of the answers. Ideal. Mark solved?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Experimenting with GridBagLayout

    Inset values are one way. You can also add an "invisible" JLabel into one of the empty columns to make it >0 width. eg JLabel padding = new JLabel(); padding.setPreferredSize(new …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 3D Perspective of Color

    Like I said right at the beginning... I suggest you look at JavaFX. According to Oracle JavaFX is the future of GUIs, and replaces Swing for new applications. ... JavaFX …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in error : non static variable cannot be referenced from a static context

    > which technically might mean it's no longer an inner class but a static nested class It does indeed mean that. From the [Oracle Java Tutorials](http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html)... *The Java programming language …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Why isn't my image loading on my JPanel??

    You insult us by suggesting we didn't read your post "carefully". Your original post was perfectly clear, as was the cause of the problem in your code. Three people have …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in help with this

    Don't just take code and try to paste it into your program. Spend 10 brief minutes with the relevant tutorial so you will understand what to do, and why... http://docs.oracle.com/javase/tutorial/essential/exceptions/index.html …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 'Overlayed' Panel/ Docked Panel.

    Although a layered pane has no layout manager by default, you can still assign a layout manager to the layered pane. http://docs.oracle.com/javase/tutorial/uiswing/components/layeredpane.html#layout
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 3D Perspective of Color

    Yes, you can do that easily. Maybe it's time to hack something simple/disposable together and start experimenting.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 3D Perspective of Color

    I don't think there's a general answer to that. It all depends on the "shape" that your data takes in the 3D space. You certainly can make some pixels partly …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 'Overlayed' Panel/ Docked Panel.

    Other way round. You add the layered pane to your JFrame, then add everything to the layered pane so you can overlap things as required.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in multithreading in parallel in java

    That's getting a lot closer! When you create a new instance of MyThread that instance needs to know (1) the country name and (2) how many times to cheer. Then …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in error : non static variable cannot be referenced from a static context

    OK, that confirms that ~s.o.s~ was right (see his post above).
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in String Reverse Program

    Naresh. It's good that you want to help, but your post exactly duplicates the solution given by dlarytm two days ago. Please take a moment to read the whole thread …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in How to set the title of the JApplet program?

    A bit late (3 years) don't you think? Did you try your solution? Do you have a complete minimal executable demo of it in action?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Game or System

    OK people, let's just cool down a bit. Fatima: I'm not sure how people can answer this thread. If anyone had any ideas for projects they will have added them …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in error : non static variable cannot be referenced from a static context

    Which line does the error refer to?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Why isn't my image loading on my JPanel??

    Sorry. This is a "we give you help & advice" site. We don't offer free coding services! Try it for yourself, and if you get stuck come back here and …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Polynomial Program

    That looks like you didn't enter an int value in response to the "Enter first coeffecient: " prompt. ???
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Markov Matrix

    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 Why isn't my image loading on my JPanel??

    Overridding `paint` rather that `paintComponent` is almost always a mistake. In this case you call super.paint - which paints the Panel *and all its children*, then draw the background image …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 3D Perspective of Color

    There's no problem mapping a Color to a point in 3D space, nor in associating a colored pixel or two with that point. As with any 3D data representation it …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in 'Overlayed' Panel/ Docked Panel.

    +1 for JLayeredPane - it's what it was designed for
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java

    You will find much useful inmformation [here](http://www.daniweb.com/software-development/java/threads/99132/starting-java-java-tutorials-resources-faq)
  • Member Avatar for JamesCherrill
    JamesCherrill

    Edited Calculate overtime with if statement? please assist

    hello everyone. i have been attempting to make an if statement that calculates overtime hours for quite some time now and i cant seem to get it to work correctly. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Game or System

    If there's absolutely nothing in the beginner's project thread that "satisfies your needs", then maybe you can explain what your needs are, so someone can make suitable suggestions.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Began Watching multithreading in parallel in java

    I am to create a program which creates multiple threads, has them do work in parallel, and terminates when the last thread is finished, sounds simple right? Here is the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in multithreading in parallel in java

    This problem breaks down into two distinct stages: 1. Collect all the info from the user (10 names, 10 counts) and store those in two arrays... then... 2. Using that …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Pothole Detection App

    What is your major subject for your degree? Plagiarism? Seriously: If you need to "make an app" then just copying someone else's code is not going to qualify. If you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Test score and constructor

    That's your answer. You refer to a class TestScores on line 36, but nowhere do you have a definition of TestScores.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Composition vs inheritence in JButton

    I don't believe you can. You can only add Swing/AWT components to a JPanel.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Test score and constructor

    First point: never say "gives me an exception". Alwyas say exactly what the exception is and which line its on. Second: on line 43 you check if ts is null, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Using the padLeft Method...stumped

    Yes, that does it. Here's a slightly different test code that shows the results more clearly: System.out.println("|" + padLeft("Hello", 12) + "|"); System.out.println("|" + padRight("Hello", 12) + "|"); Please give …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Using the padLeft Method...stumped

    1. Everyone here was a beginner once. There's no such thing as a dumb question. Don't be afraid! 2. You don't need a new class. You could put a main …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Using the padLeft Method...stumped

    Run what program? Where's your main method? To use those methods you need to call them and print the result, eg System.out.println(StringUtils.padRight("Hello", 12));
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java JButton focussing and reacting to enters

    Did you try frame.getRootPane().setDefaultButton(goButton); ?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Encryption/Decryption

    The book he's working from explains exactly what method to use - it just replaces a few specific letters with some garbage strings. It's not anything to do with encryption …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Grading system

    ... or, while we're having fun... for the simplest possible code and easiest maintenance, build a TreeMap with the upper bound of each range as key and the grade as …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in program code about log in information using java JFrame

    DaniWeb Member Rules (which you agreed to when you signed up) include: "Do not hijack old threads by posting a new question as a reply to an old one" http://www.daniweb.com/community/rules …

The End.