Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

Brian Mart

Ranch Hand
+ Follow
since Apr 17, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brian Mart

Yes I understand. I worded that post poorly. I meant it as, "ok, removing all other components of the code that would create problems with naming conventions..." not "please ignore how terribly I am writing this". The original code was terrible, I know. But the revised, shortened code was just the brass tax of one class. Sorry again for the confusion and never meant to create all this hostility
7 years ago
Ok, my bad. First of all, I deleted all of the naming conventions you guys called me out on before in order to simplify the problem. I understand that my names were confusing, I am just looking for help as to why I cannot call this variable. Sorry for seeming impatient, I just have been looking for answers to this problem on my own for days and I am incredibly frustrated, just looking for a little guidance. I was unaware of the "no delete" policy as well. Forgive me.

Anyway, the exact error message is "cannot find symbol - variable Random_10" on line 7

Clearly just having trouble understanding how to call variables into the main class. Maybe I am reading it wrong, but from what I can see around the web, I have it right (although I know I must be missing something)
7 years ago
Ok I have been researching for days and I still cannot find a reason that I am getting this error. I will delete this post as soon as I get an answer, as it is an assignment. And please ignore naming conventions for the time being, I am just trying to figure out why I am getting this "cannot find symbol - class insertion_srt1" error on line 7. This is a simple call of a class from the main class, correct? Thank you tremendously in advance for any help.
7 years ago
Haha sorry. My compiler gives me the error "cannot find symbol - class insertion_srt1"
7 years ago
I know this is simple I just can't get around this problem for whatever reason. All I am trying to do is call multiple similar methods within the main method. I have looked at examples online and most say to make the method static and there should not be a problem, but I am still having a problem. To make matters worse, this code used to work just fine, but I had 9 main methods, and it was just ugly. Here is what I have:

7 years ago
Ah yes. Thanks, I have been away from Java for a while now and completely forgot about that.
7 years ago
Hello all,
I am working on some code to sort different files using different sorting methods. The code is running fine and I am getting correct results from the number of comparisons and operations, but when I call yo output the file, the text is garbled and far from correct. For example, the file "10_Random" contains 20401, 11087, 62176, 70095, 20947, 20098, 90914, 53475, 51251
and 20065. However, the output after running the file for both "sorted" and "unsorted" is "[I@5ab328" gobbleygook. What is the problem here?
7 years ago
I have not learned enough to incorporate playing vs a computer, especially at different difficulty settings, but that is a good goal for the future. I do not have enough experience in this matter, but would it be possible to rotate the array on the GUI by a certain degree in order to fix this rendering issue?
8 years ago
1)

2) I plan to make each piece of the board game its own clickable object, where you can click to pick it up and release to put the piece down (as long as it is a legal move)

3) The goal of the game is to get all of your own pieces into the opposite side of the (blue to green, black to white, yellow to red). You can jump your own pieces as well as others (jumped pieces stay on the board, unlike "normal" checkers) and a player can make as many jumps as possible with one piece in one turn, so setting up a path to quickly jump across the board is critical, but so is playing defense so your opponent cannot also quickly jump across the board. The game must be played with 2, 4, or 6 people.
8 years ago
Hello all,
I am looking for help to get started making a Chinese checkers game using Java (if possible). This isnt for a class, just trying to refine my Java skills. Could anyone help me out with what to start with? Specifically, I am unsure how to make the board for the game. Could anyone poiint me in the right direction? I think I know how to do everything after that. For reference, a Chinese checkers board is a 6-point star. Thanks for the help!
8 years ago
I wrote that code to ensure that everything in that field was a String, no matter what. Anyway, I have had time to complete this code and fix my problems over the past few days. Thanks for your help
8 years ago
Sorry, your answer has left me a little confused. I already have a class called AddPetButtonHandler that has an ActionListener, and I am looking to get this class to store the information that is typed ( using .getText() ) but I do not understand how to transfer this gotten text into an array.
Also, this is the first time I have used a combobox and I am unsure of how to store that infomation, as I cannot use .getText() to store the boolean value of the combobox
For a better idea of what I am trying to do, here is a slightly updated code:
8 years ago
Hi! I'm still working on getting the basics of Java down and I do not understand arrays completely. I am working an a GUI where a user can input data for as many people as the user likes (int age, boolean gender[from a combobox], and String name) and store all of that data into an ArrayList. The other button of the GUI outputs the ArrayList to a text file, but I know how to do that. What examples or API classes can I look at to understand this and write my AddButtonHandler code?
Edit for clarity and some additional code

8 years ago
Hello all,
I understand that .equals() compares the content of the field, while == compares the hexcode location of an object, but there are still some things troubling me. Specifically, if I want to check for equality of the age of something, would I use == since it is an int and Java would read all equal numbers as the same? I know a String is always compared with .equals(), and a boolean value is compared with ==, but what about doubles, ints, and floats? Let me know if this question is too vague and I will provide some example code. Thanks for your help!
8 years ago