2,777 Posted Topics
Re: Is "cast" the right word to use here? Would the more generic term: convert be better? I think of cast as a coding technique: a datatype in parenthesis () before an expression. | |
Re: Have you looked up the 404 status/return code? | |
Re: What questions do you have about writing this code? Do you have problems, please post them. ![]() | |
Re: One exception to the holding of a lock when in a synchronized block is if the code calls the wait() method. It then releases the lock. | |
Re: [QUOTE]hard to extract the entrance time from the file [/QUOTE] Are you gettting compiler errors? Please post the errors or please explain what the problem is. Where is the enterListener() method? I see this: enterButton.addActionListener(new enterListener()); which looks like enterListener is a class and not a method. You don't use … | |
Re: [QUOTE]I want to store variables in a text file (not as an object)[/QUOTE] Can you explain what you want to do? Text files usually contain Strings. If you want to write values of some String variables to a file that should be no problem. You won't be able to write … | |
Re: [QUOTE] why not start method starts executing rather than going back to main class(A here)?[/QUOTE] When you call start() for a Thread you tell the OS to put the referenced thread in the queue of threads that it maintains. When the OS decides, it will chose one of the threads … | |
Re: Look at the Observable class. It might provide some help for you problem. ![]() | |
Re: Is Your problem: Finding the correct algorithm? Or is it writing a correct program to follow your algorithm? Can you explain the algorithm you are trying to program? What are the steps you need to take to solve the problem? | |
Re: [CODE] super.paint(g);[/CODE] That may be clearing the old drawings. Remove it to see what happens. Removing is not the solution as you will see. You need to have a way to "remember" what was drawn previously so you can draw it again. You could put all the values in a … | |
Re: [QUOTE]printing to the screen etc) while waiting for input.[/QUOTE] Could that result in output and input being mixed together? | |
Re: [QUOTE]bunch of unknown to me errors are coming up.[/QUOTE] Please copy and paste here the full text of your error messages. Why so many inner classes named frame? When using the BorderLayout only ONE component can be placed in each location. You are placing more than one in them. If … | |
Re: Which line in you source is the error on? I don't see the line you mentioned: list.add(); All the calls to add() have arguments, none are empty like you say the error is about??? | |
Re: Another way to find your desired lines in the file is to use a String method to see if the line has the String in it you are looking for. The String class also has methods for getting at the substrings that are delimited by your marker character(:) | |
Re: [QUOTE]NoClassDefFoundError: AconsultaMysql (wrong name: webconsultas/AconsultaMysql)[/QUOTE] Is your class in a package? If so you need to include the package name in the code= tag: code="webconsultas.AconsultaMysql" | |
Re: [QUOTE] the only error i am getting [/QUOTE] Please post the full text of the error messages and your questions. | |
Re: [QUOTE]How do I do this in Java giving the same output as the C++ program? [/QUOTE] Can you look at the file the C++ program generates with a hex editor? If the contents of the file are the bytes for an int variable, a java program can write out the … | |
Re: I don't know if you can have two classes using the same InputStream object. I've never tried it so it could work. How would the two different classes not get in each others way? What if one class reads a full buffer of data, but only processes part of it. … | |
Re: [QUOTE]when you reach the last employee in record the Next and previous buttons should be disabled[/QUOTE] Do you know how to detect when the last employee record has been reached? Do you know how to disable a button? Read the API doc for the button class for a method to … ![]() | |
Re: [QUOTE]I am having trouble with this last part[/QUOTE] Please explain what your problem is. If you are getting errors, copy and paste the full text of the error message here. What is that last piece of code you posted supposed to be doing? | |
| |
Re: [QUOTE] why it formatted weird.[/QUOTE] Could be your tabs are set differently than the forums. Can change your tabs to spaces? [QUOTE] I don't know how to (take the sum) or how to search through the arrays to check the values.[/QUOTE] Write a simple program that works with a loop … | |
Re: [QUOTE]stop the execution of codes on error[/QUOTE] It works the opposite way. A catch can allow the program to continue executing when there is an error. Go to this site and read up: [url]http://docs.oracle.com/javase/tutorial/essential/exceptions/index.html[/url] | |
Re: [QUOTE]What do I need to do to make it work to display like the picture above?[/QUOTE] Look at what your code does for each statement it executes. Play computer by tracking thru the logic using a piece of paper and a pencil writing down the values of the variables as … | |
Re: [QUOTE]ArrayIndexOutOfBoundsException?[/QUOTE] Your index is out of bounds. Print out the length of the array where you are having the problem and compare its size with the index value shown in the error message. Remember arrays are zero based. The max index is the length - 1 | |
Re: Check the pairing of the {}s in your code. Also the code is not indented according to standards. Code nested within {} should be indented 3-4 spaces for each level of nesting of {} | |
Re: The BoardButton class definition is missing. | |
Re: Can you ask specific questions about your program? Are you asking how to make a loop that indexes through an array and calls methods for the objects that are elements in the array? | |
Re: [QUOTE]I'm not sure to as why it wouldn't work[/QUOTE] Are you getting errors? If so please post the full text of the messages. Is the program output incorrect, if so please post the program's output, eplain what is wrong with it and show what the output should be. | |
Re: [QUOTE]I'm having problems with[/QUOTE] Please take the methods one at a time and explain what your problem is with it. Describe in detail what the method is supposed to do and explain your problems writing the code to do that. | |
Re: Look at the Integer class. It has methods to convert int values to different Strings for displaying. | |
Re: How does your code change the value of the counter? Add some printlns to show the value of the counter every time it is changed and to show it when it is being tested. | |
Re: [QUOTE]Need some help fixing the errors in my code,[/QUOTE] Please post the full text of the error messages if you need help with them. ![]() | |
Re: [QUOTE]I need to be able to read lines of code from a .txt file, and then execute them in Java. [/QUOTE] Yes, you could use classes that implement the JavaCompiler interface to compile a java program within your running java program and have the class files created available for using … | |
Re: I suggest you read the API doc for the String class. It will answer many of your quesions. Go to this site and Find String in the lower left, click on the link and the API doc will be in the main window. [url]http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/[/url] | |
Re: Have you an algorithm for outputing the numbers in the order that you want them to be printed? Is there one algorithm for all the output or is there a different one for each pair of outputs you have posted? You have posted a lot of samples of program output … | |
Re: Is this thread the same topic as [url]http://www.daniweb.com/software-development/java/threads/399522[/url] | |
Re: Your optimistic that the OP remembers this after 9 months. | |
Re: [QUOTE]what I have to put in the main class for them tu run?[/QUOTE] Both those methods need to be called with an ActionEvent object for parameter. You can get that parameter by adding an action listener to a component like a button. When that listener's actionPerformed method is called it … | |
Re: [QUOTE]encrypt by making letter a letter z and b, y [/QUOTE] Perhaps if you printed out all the values of the variables as the program executed you would see what the program is doing. Do you test with short simple Strings like "abc" and see what happens to those 3 … | |
Re: [QUOTE]How do i transfer the input from the main method to the getBoard constructor method.[/QUOTE] Confusing terminology. Is getBoard a class with a constructor or a method in a class? Either way, you pass data from one method to another as arguments to that method. A very standard thing. Can … | |
Re: Do you have to continually check the database for the date? Or does it stay the same once you have read it? If the date that is read is unchanged after you read it, you could use a Timer to call a listener after waiting the time from now to … | |
![]() | Re: [QUOTE]clear button isnt working.[/QUOTE] Add some debugging printlns to your code to show the values of the variables as they are set and changed. |
Re: [QUOTE] it doesnt work[/QUOTE] Please explain what the code does. It doesn't work covers lots of cases. Show the console from when you execute the code and add comments to explain what is not working. To copy the contents of the command prompt window: Click on Icon in upper left … | |
Re: The first problem is this code does not compile. | |
Re: If the data always comes in groups of three lines, read the three lines, process the data for the three lines and then read the next group of three lines. | |
Re: What code causes the NullPointerException at line 84? You should include all you image files in the jar file so you don't need to worry about reading them from the disk. | |
Re: What code is in the Main class? Will the Main class be an inner class? Or is the Main class the class with a main() method that will create instances of the Rational class and call its methods. There is no need to create a separate class just to hold … | |
Re: [QUOTE] deriving the values for q,d,n, and p[/QUOTE] Single letter variable names are a poor technique. Use full words for variable names. Put it all where you want it: [CODE] (ten$ + " ten dollar bill" + ((ten$ > 1) ? "s":""))); [/CODE] | |
Re: [QUOTE]if ( gender = male ) [/QUOTE] This is an assignment statement (=) not an equality test (==). [QUOTE] i don't know what to do next.[/QUOTE] What have you written code for and what do you need next? |
The End.