2,777 Posted Topics
Re: [QUOTE] I do not understand how to move it in front of random element[/QUOTE] Before you write code, you need to come up with an algorithm or design describing what the code will do. What do you have for a design? If you were to do it manually with a … ![]() | |
Re: What is the formula or equation to generate the numbers in that series? When you get that, we can help you write java code to output those numbers. | |
Re: Have you tried adding printlns to the code to see what controls how many times it prints? Print out the values of the variables that are used to see how they change and how they relate to the output. | |
Re: Can you post your current code? Try debugging your code by creating a File object with the path to the image and printing out the File class's exists() method's value. | |
Re: [QUOTE] it still has some errors[/QUOTE] Please copy the full text of the error messages and post them here. | |
![]() | Re: [QUOTE] my answer isn't correct[/QUOTE] Please copy and paste here the input and output from the program and explain what is wrong with the output and show what the output should be. Is your problem: you don't have the correct equation or your code is not following the equation that … ![]() |
Re: I'd start with a simple package with a single path/symbol. Write some code, compile it and execute it to see how it works. | |
Re: [QUOTE]the output is being to give only the last value i enter[/QUOTE] Are you saying that tt only contains the last value you enter? What is a table object? What does the insertaddhop method do? Is the insertaddhop() method being called? Add a println to that method to show what … | |
Re: Look at the Apache packages for interfacing with MS word documents. It is not part of standard java. | |
Re: [QUOTE]It is returning this: [Ljava.lang.Integer;@addbf1[/QUOTE] That printout is from an array of Integer object's toString method. It returns the datatype and the object's hashcode. If you want to see the contents of the array, use the Arrays toString() method to format it for printing. To get a single element use … ![]() | |
Re: [QUOTE]how to use an external server to update a variable.[/QUOTE] Your program could request the data from the server. Where is the variable being used? ![]() | |
Re: Does the printf method take formatting rules that will insert ,s into numeric output? Look at the API doc and at the DecimalFormat class for example. | |
Re: If one button is on top of other buttons, what happens to the buttons that are underneath? | |
Re: Can you make a SSCCE and post it that shows your problem? | |
Re: [QUOTE]The code below always returns the arrayLength = 1, which with an already filled array it is supposed to be 5.[/QUOTE] Can you post code with the array filled as desired that compiles, executes and shows the problem? Try debugging your code by adding a println to show the value … | |
Re: The values you are seeing:[Ljava.lang.String;@defa1ais [Ljava.lang.String;@f5da06 are the Strings returned by the default toString method for String arrays. If you want to see the full contents of the arrays, you could use the Arrays class's toString() method to format it. If you only want to see one element from the … | |
Re: What was wrong with the logic and technique in the first code you posted? | |
Re: See the Random class for a way to generate random numbers. [QUOTE]a way to generate a random number for each location in the 2D array[/QUOTE] What are you asking here? Are you trying to randomly access an element in the array, or are you trying to generate a random number … | |
Re: Where is the exception happening? Post the full text of the error message because it has the line number. The exception says that the user entered the wrong kind of data. Your code should put the input statement within a try{}catch block to catch the exception and tell the user … | |
Re: Look at the constructor for the Thread class. How does it connect to the code in your run method? How would the Thread object find your code? If you don't give the Thread class an object with a run() method, it will use its own. For more info: Read the … | |
Re: The if statements seem simple enough. There are 4 calls to drawImage and then a choice of one of two calls to drawImage. Which of the drawImages is not doing what you expect? 1-4 or 5/6?? | |
Re: [QUOTE]it doesn't seem to work[/QUOTE] Can you explain and show the error messages? What is "BinaryOut"? | |
Re: [QUOTE] I think the problem is, x won't retain the value..[/QUOTE] What do you mean by "won't retain"? Is some code changing the value from the one you give it to another value? What value do you give it? What value is it changed to? | |
Re: As always, check your spelling. Look in the jar file with a zip file utility and check its contents. You jar command doesn't appear to use the manifest file | |
Re: Why do you think that class exists? Where did you see it used or recommended? Why do you need it? | |
Re: [QUOTE]cant figure out what is the error [/QUOTE] Please copy and paste here the full text of the error message. When comparing the contents of String objects you should use the equals() method not the == operator. Why is this commented out: /*if (a.equalsIgnoreCase("B"))*/ | |
Re: Try changing around the changes you are making to each of the components where you are calling different methods on each to set this and that. When you find the right combination it will work. Anyways that's what I did to get it to work, so I'll let you go … | |
Re: Have you found the null variable and determined why it is null? Add some printlns to print out the values of the variables on the line where the exception occurred. | |
Re: Where are you stuck? Do you have any specific questions about the program? | |
Re: Why start a thread that does nothing? Start one every time you need one to carry out the task. Let it do the task and exit/end. | |
Re: Please explain what you code does that is not what you want it to do. Post the output from the program and explain what is wrong with the output and show what you want the output to be. A suggestion for debugging: Do the steps one at a time and … | |
Re: [QUOTE] there such thing in java that already has public holiday dates predefined[/QUOTE] Public holidays are local. It would be necessary for Java to know where the code is being executed to determine if any day was a holiday. I don't think you will find anything in Java that already … | |
Re: [QUOTE]I fail to recognize, while I create 100 records for each file,[/QUOTE] How are you keeping track of the number of records written to a file? I don't see any comments in the code describing what it is supposed to do. Some suggestions for debugging your code. Replace the hardcoded … | |
Re: [QUOTE]tell me what I should do[/QUOTE] Basically debug your code, find the error(s) and correct them. One technique for debugging code is to add println statements that print out the values of the variables as they are changed and used. The print out will show you where the code is … | |
Re: What happens? Do you get errors? If so please copy and paste the full text here. Otherwise show the programs output and explain what is wrong with it. | |
Re: The String class handles all that. There must be a similar class in C++ | |
Re: [QUOTE]I want to move from one button to an other depending on the roll of the dice[/QUOTE] Can you explain what you mean by "move"? What is a user supposed to do when using your program? What is the program supposed to do? | |
Re: [QUOTE]I would like to draw something on my panel. But I'm not able to draw anything[/QUOTE] What method is supposed to do the drawing? Is that method called with a graphics object for the JPanel that is shown in your GUI? Can you make a smaller simpler program (SSCCE) that … | |
Re: [QUOTE]How can I resolve this issue_ [/QUOTE] Can you explain the issue? What changes do you want made to the data when it is copied from the text area to the file? | |
Re: Cookies are fields in the HTTP headers. Do some searches about the HTTP protocol to see what is in the headers. | |
Re: [QUOTE]when the variable reaches 45, it ceases to do anything at all[/QUOTE] Please explain. Try debugging your code by adding printlns to show where the execution flow is going and to show the values of variables as they are changed. The print out will show you if the code is … | |
Re: [QUOTE]How do i extract the 6th line for multiple files[/QUOTE] Read through the first six lines and save the last line read. If the sixth line is at the same offset in all the files you could use a RandomAccessFile to read the last line without reading the preceding lines. | |
Re: Your code reads the binary(ASCII) value of the character as an int. If you want to see the int as a character you need to cast it to a char. '1' has a value of 49 Try this: System.out.println("49=" + (char)49); | |
![]() | Re: You can have the same variable refer/point to different objects over time. You can create an object with a variable and add it to the array list. Now the array list has the reference to that object. You can then create a new object with the variable. pseudo code begin … ![]() |
Re: What happens after you create a new instance of the AnimalProfitRatioCalc class in the button listener? What do you expect to happen? Look at the first place you create an instance of AnimalProfitRatioCalc. What does that code do? | |
Re: Have you added that option for the compiler and compiled the code to have the compiler show you the statement that is causing the warning? | |
Re: [QUOTE] it comes out weird [/QUOTE] Can you explain what happens and perhaps copy and paste here the programs output. |
The End.