- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 15
- Posts with Upvotes
- 12
- Upvoting Members
- 11
- Downvotes Received
- 3
- Posts with Downvotes
- 2
- Downvoting Members
- 3
- Interests
- I like anything that deals with computers and technology
42 Posted Topics
Re: What you can do is assign the button an ActionListener so that every time it is pressed it uses the Robot class to press the backspace key. You have to keep in mind that once you press the button the focus will switch from the text field to the button … | |
Re: Scared Straight...For Math Little Tommy was doing very badly in math. His parents had tried everything; flash cards, special learning centers, in short, everything they could think of. Finally in a last dash effort, they took Tommy down and enrolled him in the local Catholic school. After the first day, … | |
Re: Following the logic of this program: the main method calls "prompt_and_read();", this method simply takes in an unsigned integer and returns it to the main method. From there the "mystery2();" method is called. This is what I am assuming you are asking about. What is going in this method are … | |
Re: Use a for loop to iterate through the string from left to right until you find a whitespace character(java.lang.Character.isWhitespace(int CodePoint)) Once that condition has been satisfied use a variable whose initial value would be zero and then use the (java.lang.String.substring(int beginIndex, int endIndex)) to extract the first number(still as a … | |
![]() | Re: Check out the toLowerCase() method and the toUpperCase() method in the java.lang.String class. These method's should let you convert the input so that it always matches what you are checking for. ![]() |
Re: Just pointing this out, the Scanner class only reads the input so whatever you write that's what its going to read despite how long or how many words it has. Thus I think your problem is when you are parsing the input that you are getting errors, which the Scanner … | |
Re: Looks to me like "account_inf" holds the information of all of your accounts, so in order to make it work you should add two more parameters to that method to tell it which accounts to access from the array. | |
Re: Two things are wrong with your code: The first is in the second for loop where you check the random numbers...you used the variable "randomum" when it should be "randonum". The second problem is more complex, you see you declared the counters and the arrays as local variables in a … | |
Re: this will do the trick: [CODE=java] static String reverse(String userInput) { String temp = ""; if(userInput.length() >= 1) { temp = userInput.substring(userInput.length()-1, userInput.length()); temp += reverse(userInput.substring(0, userInput.length()-1)); } return temp; } [/CODE] | |
Re: Getters and setters are the basics of Object-Oriented Programming, they allow encapsulation of class members. The reason why they are useful is because by making the field private and only allowing that field to be modified through a setter method you can make sure that no one [B]outside[/B] of your … | |
Re: Overloading is compile-time polymorphism because it is during compile time that the JVM figures out what method to call by checking what was passed in the arguments to the overloaded method. [CODE=java] //depending on what was passed as the arguments the right method is chosen at compile time public int … | |
Re: Read this thread: [url]http://www.daniweb.com/software-development/java/threads/371984/1602357#post1602357[/url] and for future reference, search the forum before posting, maybe your question could have already been answered. If you still don't understand it let us know. P.S I linked to my reply in that thread, but I encourage you to read the entire thread | |
Re: What you have there is an empty array, by practical standards it doesn't serve much purpose considering that an array object's size is immutable. But it is widely used to return from methods. For example lets say you have a method that returns all the birthdays of people you know … | |
Re: Well here is a hint: type "java" on your cmd...you should get that very same message. As for the size of the file I can tell you that that could be the problem, about a year ago I was writing a program that used three massive arrays and I had … | |
Re: Ok so from what you have just stated it seems like you are using an ArrayList of Doubles: [CODE=java]ArrayList<Double> data = new ArrayList<Double>();[/CODE] Right? If not than you should know that the only way to convert a string(from your file) to a double is to use the ValueOf(String s) method … | |
Re: Try using a BoxLayout instead of GridLayout: [CODE] //wholeItems.setLayout(new GridLayout(2,1)); --> replace this line with: wholeItems.setLayout(new BoxLayout(wholeItems, BoxLayout.Y_AXIS)); [/CODE] This assumes that the buttons are packed into a grouped some how, I would use a Box - javax.swing.Box; - with a GridLayout. Once you have that than you can safely … ![]() | |
Hello I am seeking guidance for a project that requires the use of a database. Obviously I will be programming in Java! my question really is: what is the best database that can be used with Java? My program will be a desktop application which will use the database locally, … | |
Re: The thing that needs to be point out is that Java is [B]strictly[/B] pass-by-value. When you encounter a method which has primitive arguments: [CODE=java] public void display(int a){ System.out.println("An integer: "+a); } [/CODE] The Java Virtual Machine allocates a temporary memory address(Ex. 1200) for that variable which holds a copy … | |
Re: Hey sorry I'm not here to answer your question but to ask one. When you run this code does it play the midi and the code stops running or does it it keep running after it plays the sound. The reason I'm asking is because whenever I run code similar … | |
Re: Here are three solutions: 1. Make your instance variables (xCoor, yCoor etc.) public that way the subclass can see them and use them however it wants. 2. Use the getters and setters methods, you have them there for a reason, ;) though you are going to need an instance of … | |
Re: Because Regex is somewhat of its own language and it uses special characters for formating you have to put two backslashes in front these characters to specify that they are part of the text and no some sort of command per say... [CODE] String folderPath1 = "[AAA BBB CCC]"; String … | |
Why did the chicken cross the road? To find the rate of impact failure between v1.0 and v2.0 P.S think of a new word that starts with “V” Now that you know, my responses to this question write your own. | |
| |
Hello everyone, first of all I would like to say that I'm new to java and I'm getting this error while trying to compile a program from a book that I am using to learn the language. Ok so the program is very basic just two classes here is my … | |
Alright guys, so right now I'm working on a program that finds the current focused window and adds a KeyListener to it. The problem is that unlike when you have a window running and you add a KeyListener to it and it stays working until you close the window, once … | |
Hello everyone, as some of you might know NetBeans 6.9 has been release, now I already have 6.8 installed on my computer. The problem is that whenever I try to uninstall NetBeans 6.8 I get some weird error and I don't know how to fix it. Here is what I … | |
Re: Class SpFwUpgrade throws and Exception, you are catching an STAFFException. Because exceptions are polymorphic meaning they have a hierarchy that means that any other exception that extends the class Exception will be lower in the hierarchy. Therefore you can't expect a STAFFException to work where an Exception is expected. Hope … | |
Re: Ok so I wrote a method so that you don't have to duplicate your code for each array all you have to do is pass the array to the method and it will return true if all the numbers are less than 10. I also made the method static so … | |
Ok so I'm learning from the book Head First Java, second edition, and I'm having a little trouble with some code. The code I'm working with compiles just fine and gives the output that I want(sort of) but whenever I run the code is doesn't stop, as if it was … | |
Re: Hope this solves your problem. [code=Java] public static void convertMillis(int Millis){ String convert = String.format("You have %d hour(s), %d minute(s), and %d second(s)", Millis/(1000*60*60), (Millis%(1000*60*60))/(1000*60), ((Millis%(1000*60*60))%(1000*60))/1000); System.out.println(convert); } [/code] | |
Alright guys so I have a little problem with a nested list. so here is my list: [code=python] a = [[1,2,3], [4,5,6], [7,8,9]] #I know that I can do for example a[0][0] and that will return the first value in the first nested list but I don't know how to … | |
Re: A Mexican bandit made a specialty of crossing the Rio Grande from time to time and robbing banks in Texas. The banks offered a reward for his capture, dead or alive, but offered a much larger award for the recovery of the stolen funds. An enterprising Texas Ranger decided to … | |
Hello everyone, ok so I am working on this code that takes a string and splits it using the re module. The string contains words in between "<" and ">" (sometimes multiple words). Now what the program does is it splits the string using the two characters above. Then it … | |
Hi everyone I am writing this program that takes a string and search it for words. Those words are taken and they get "<" at the beginning and ">" at the end of the word. then it prints the string with the words and the "<, >" characters. Here is … | |
Hi everyone I have a question but I don't know if it can be done in python. Ok so this is what I want to do: I have two scripts [code=python] string = "hello world" [/code] and [code=python] def output(): print string [/code] Now what I want to do is … | |
Ok so for the last couple of days I have been struggling with file handling. Here is my problem I create a new file and write some text into it. Then I open it again to add more text to it but somehow the new text is being written in … | |
Ok so I was working on file handling, nothing special just making new (.txt) files and putting some text in it. That works fine the problem is that when I try to read the file from within python nothing comes up and when I try to open the file once … | |
Hi everyone it's been almost a year since I gave up programing in python so I have forgotten a lot of things, so just bare with me. Ok so I was playing around with python and ended up with this little program. [code=python] def test(): number = input("Number: ") scale … | |
Ok so I found this game on another website and I though it was fun so I'm going to post it here. Lets see how far we get So here are the game rules: first you say something about the person above ^ then a bit about yourself < then … | |
Hi everyone I dont know if this question has already been answer but I really need help so bare with me. So here is my problem I just downloaded python 2.6 for windows however whenever i try to open the IDLE i get this message: IDLE can't bind TCP/IP port … | |
Re: Lists are what they seem - a list of values. Each one of them is numbered, starting from zero - the first one is numbered zero, the second 1, the third 2, etc. You can remove values from the list, and add new values to the end. Example: Your many … | |
Re: never mind....oops |
The End.