- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 4
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 1
18 Posted Topics
Re: I think that you are getting the IndexOutOfBounds exception, because when you test your method you have forgotten to actually populate the array with elements. I also don't like your "if" statement. Why don't you just use a try catch block and catch the out of bound exception (this exception … | |
Re: Not going to go into much details here. But to make your program work (so you can see the output and continue developping it, this can't be your final version) replace your main method with this: public static void main(String[] args) { Hangman game = new Hangman(); game.newGame(); } | |
Re: Hi you've almost had it correct. :) I modified your code a little bit and think I made it work. Here is the bad boy: package test; import javax.swing.JFrame; public class WindowFrame { public static void main (String args[]){ JFrame myWindow = new JFrame(); // 1. declare and initialise variables … | |
Re: For the sake of variety, I will add that you can have both frames all the time, but switching their visibility using setVisible(); to true or false. | |
Re: Hello, Haven't run your code, only scanned through it, so appologies if I didn't get this one right (what are the chances !? :P). For me the problem is on line 104: firstAndLastMap.remove(lastName = " , " + firstName); Surely you wanted to say firstAndLastMap.remove(lastName + " , " + … | |
Re: I am not very familiar with Jspinners, but here is what found during a quick browse of the API : http://docs.oracle.com/javase/7/docs/api/javax/swing/JSpinner.html#setValue(java.lang.Object) All in all I suggest you try the setValue(), on your spinner. Another suggesetion would be to evalute the IDE that you are using. Some IDEs support code completion … | |
Re: Hello there, I can see that you don't quite get how arrays and traversing them work. Not to worry !!! Imagine a restaurant menu where the dishes are numbered. For example : 1. Chicken 2. Beef 3. Fish ... Then when you want to order you can just say "Can … | |
Re: My guess would be that the image is in a different folder from the one your java class is in. | |
Re: I gotta admit, I have asked random ppl in forums to "help" me with my assignments, but I can assure you that is not the right way to go! I can advise you to grab a priece of paper and write down exactly what your program should do. Then try … | |
Re: Hello, What James is suggesting is your answer! I can only add that when you move the the stuff in the while loop you should not forget to set cont to true instead of false. Here is what your code might look like: import java.util.ArrayList; import javax.swing.JOptionPane; public class MemberList … | |
Re: If that is a web application, store the data in hidden input fields which you can spawn via Jscript. However, the same priniciple can be applied in a JFrame extending application (just to go frame.setVisible(true);). Hope this helps. | |
Re: Hello, When I looked at your code I felt that the "while" loop was trouble :D The next thing was the use of "&&", which is the logic operator AND therefore you were checking that: (arrayAnswers[index]!=('a') AND (arrayAnswers[index]!=('b') AND arrayAnswers[index]!=('c') AND (arrayAnswers[index]!=('d'), which to all honesty can never be be … | |
Re: Hello, I really like prinring patterns, so I was attracted to your question. Here is my solution. It's probably not quite what you are looking for but here it is: package test; public class PrintPattern { public String printFullLine(final int thisMany) { String line = ""; for (int i = … | |
Re: Hello, the problem was that you were trying to readObject() too many times. So what was happening was something like : while(true) { while (true) { readObject(); } readObject(); } see what am sayin' ... :) Here is my vesion of your program : package test; import java.io.EOFException; import java.io.FileInputStream; … | |
Re: Hello, If there is a whitespace inbetween the words forming your string, you can simply use the split() method. I took the time and liberty to write a very small example program. public class StrSplit { public static void main (String[] args){ final String myString = "Registration 00DL5876 Make"; String … | |
Re: If I understand you correctly you could do something like the following: final Sting roomNumberString = "2"; final int roomNumber = Integer.parseInt(roomNumberString); | |
Hello everyone and Merry Christmas. The reason I am opening this thread is that I am required to write a polynomial calculator in Common LISP as part of a Course Work. As I am newbie to LISP(s) I am asking you if anyone can help me with it . The … | |
Hello everyone. I am University of Bath Computer Information Systems student and i have to submit a java calculator. As far as i am quite new to java i would like to kindly ask you for some help with it. Here is my task: Write a program that takes as … |
The End.