Knute Snortum

+ Follow
since Apr 20, 2013
Knute likes ...
Chrome Eclipse IDE Java Postgres Database VI Editor
Forum Moderator
Knute Snortum currently moderates these forums:
After 25 years of programming, Knute has retired to be a professional musician. Knute first learned BASIC and Cobol on a CPM Timeshare system circa 1985. He spent way too long coding in one flavor of Business Basic or another. Going back to college, he learned C and a whole new world opened up to him. Knute likes Perl and Java, for completely opposite reasons. Knute is a complex person.
Portland, Oregon
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Knute Snortum

This is probably the problem:
I don't think this will ever be true.  What you probably want:
12 hours ago
What have you tried?  What happened?
12 hours ago
Thinking about it a second, I think all you need is
Scanner#nextLine() never returns null (AFAIK) and the case of input being empty is caught anyway.
12 hours ago
I would write that line more like this:
Things to notice: I am using the logical or (||) and and (&&) instead of the bitwise or (^).  I also distributed the negation (!) to inside the parentheses because I think it reads better (the input is not equal to gasoline and not equal to diesel).
12 hours ago

Campbell Ritchie wrote:

Knute Snortum wrote:. . . This method calls a constructor that hasn't been declared. . . . .

How can you call a constructor from a method?, you can't.  *blush*
1 day ago
There are these things that won't compile:
This method needs to return a boolean type.
This method calls a constructor that hasn't been declared.
Not a compiler error, but this will run without complaint if there are no command line arguments.
1 day ago
Here you have a raw ArrayList that you try to convert to an Integer array which you then try to convert to an int array.  Neither of those is going to work.

I would declare ms like this: ...then return ms.  But you would have to change the return type of your method and modify how the class uses the method.
1 day ago
I decided to not look too hard at your solution until I tried mine and see if we were close.  I was surprised by how different they were.  Mine uses the launching class Main to hold a static Map of all the scenes, all build on the launch.  I then inject the one stage into the views and controllers.  I don't have a Map of controllers.  If you're interested in seeing what I did, it's on GitHub.  I may try using FXML next time as this is my favorite way to create views.
1 day ago
Several of the entries in the HowToAskQuestionsOnJavaRanch FAQ recommend copying and pasting code and configuration settings into the edit screen instead of typing them.

Here are some tips for capturing system information such as environment variables and directory structures in a Windows environment.
This FAQ entry is aimed primarily at Windows users. Most modern Unix shell windows allow copying and pasting so the  results from the "ls -R" and "echo" commands are easy to grab.
Copying an environment variable PATH, CLASSPATH, JAVA_HOME, etc..
For Windows (from the command line)

echo %CLASSPATH% > my-classpath.txt

This will open up a text file containing your CLASSPATH environment variable in notepad; where it will be easy to copy to your clipboard.

Copying a directory structure

In this example, we're going to write the entire directory structure of the "ROOT" webapp that
ships with Apache Tomcat (assuming that the current working directory is {tomcat install}\webapps):

dir /b /s ROOT > my-directory-structure.txt

When pasting the results into the JavaRanch edit screen be sure to UseCodeTags to insure that everything is rendered as plain text with all indenting preserved.

See the other tips on HowToAskQuestionsOnJavaRanch.

See also

  • AvoidRedHerrings
  • PostRealCode

  • 2 days ago
    Couldn't you simplify validateEnteredData to
    4 days ago
    I'm not very familiar with Java EE, but I would think that you would want all three built by Maven or some build control system.  I've added this thread to the Java EE forum.
    4 days ago
    Congratulations, Pete!
    5 days ago
    If the jars aren't under the Maven Dependencies pull down then there're not from the pom file.  I've never heard of Eclipse adding jars during a conversion to Maven.  I've added this thread to the Eclipse forum to see if anyone has an idea.
    5 days ago
    I'm interested in your solution.  Post back here what you did and how it worked when you're done.
    5 days ago