2,777 Posted Topics
Re: Are you trying to create a simple IDE? Something that will allow you to edit the source and compile it? | |
Re: You will need to convert the String obtained from the textfield to a Color object. One way would be to use a chain of if/else if statements to compare the String and set the Color, or switch with 1.7, another would be to use a Map<String, Color> that has been … | |
Re: The posted code looks in a folder relative to the current directory for the image files it is trying to read. Can you put the images inside of the jar file? If so, you could treat the image file as a resource and use the ClassLoader's getResourceAsStream() method to get … | |
Re: Have you tried debugging the code by adding some println statements to show you what the code is doing? Try using the Arrays class's toString() method to format the array for printing: S.o.p("before=" + Arrays.toString(a)); // show before sort | |
Re: What program or software is executing on the server that will read what you send it and write it to disk? You will need to tell that program the name of the file and where to save it. | |
Re: Please explain why the program can not read a String vs the number from the user? Where in the code (700+ lines) is the problem? A text field takes text (String) data, not numberic data. | |
Re: > i want to capture the entire html page as image I assume that you are talking about an html page being displayed in a browser. And the html page is too long to view on the screen requiring that the browser scroll forward to the next viewing. You want … | |
Re: > insert a pre-determined string into a field on the internet If you are talking about an html page that you see in a brower, you need to look at HTML and the HTTP protocol to understand how forms are filled in and submitted to a server. > programs that … | |
Re: > if(card == "2") { Use the equals() method to compare Strings. The compiler should tell you there is an unreachable statement (after return) | |
Re: Can you post the definition for the aMap variable. | |
Re: > have to catch the value of the handRank and add it to the last value of the handRank Are you asking how to accumulate the values of handRank across several games? Define a variable to hold the total and add the current value to it at the end of … | |
Re: You need a varable that refers to an instance of the Membership class that contains the method you are trying to call. The method and data belong to an instance of the class and are not static. > Membership.getMonth(); Replace Membership (the class name) with a variable that has the … | |
Re: > my do while loop never end. what does the code do to end the loop? When is y ever set false or a break statement used? > if y or n it always repeat.. where does the program look at the value that the user entered and use it … | |
Re: > I got the IndexOutOfBoundException You forgot to post the full text of the error message that shows the value of the index and where it happened in the code. | |
Re: By angles do you mean the changes in the x and y locations of the object as it moves? If you change only the x value then the object moves horizontally. Changes in the y value moves the object vertically. Changes of both will move somewhere in between. | |
Re: Where it will be executed. First thing in the main() method would be a good spot. | |
Re: Make sure the image is in the location that the program is looking for it to be. Where is the image folder? Is it in the current directory for the program when it is executed? | |
Re: If you are getting errors, please copy and paste the full text here. ![]() | |
![]() | Re: > I'm getting a runtime error Please post the full text of the error message. ![]() |
Re: Are you asking how to find a record using any one of several keys: name, id, email address? If you must use HashMaps, and all the keys are unique, then you could store references to the same record as the value using the different keys. | |
Re: You forgot to post the code you are having problems with and your specific questions about those problems. If you are getting errors, please copy and paste here the full text of the error messsages. | |
Re: Can you post an example of where you are having a problem with the scope of a variable? A return statement can return any single value to the method's caller. | |
Re: > when I am trying to get it work from third class it wont show up Can you give the name of the "third class" and explain how you are using the Laatikko class? The posted code creates three instances of the class on lines 57, 59 and 68. What … | |
Re: Do you have code for testing? Post a small program that compiles, executes and shows the problems. How have you tried debugging the code? I don't see any println statements to print out the values of the variables as they are changed and used to control the codes execution. try … | |
Re: > man.Phone@4830c221 What you printed was the String returned by the Phone class's default toString() method. It is made of the full classname, @ and the object's hashcode(in hex). If you want to change that String, you need to override the Phone class's toString() method and have it return the … | |
Re: Can you use a loop that reads some bytes into an array and then writes those bytes? Then reads some more and writes some more until done. | |
Re: What is the relationship between the two classes? Does one create an instance of the other? If one creates the other then: When do you want to pass the values? Do you have them when you create an instance of the class? If so pass them to the class in … | |
Re: Add a method in Class1 that returns ca to its caller. What is the relationship between Class1 and Class2? Does either have a reference to the other? | |
Re: Please repost the code with proper formatting and indentation. Unformatted code is hard to read and understand. | |
Re: > It always execute else method and gives output "Something Wrong"... Add some more data to the printed message to describe what the problem is and give the values of all the variables being used in the if statements. The printed output should help you solve the problem. | |
Re: Does the code have compiler error messages? Please post the full text of the error messages. | |
Re: Can you explain what your problem is with this assignment? | |
Re: Can you post a complete program that compiles, executes and shows the problem? It looks like you are writing the data in one format (in a binary format) and trying to read it as character data. The write and the read methods should match. You should either: Write an object … | |
| |
Re: What do you mean by "go to the next frame"? Call a method in another class that extends JFrame? Hide the current frame and set another one visible? | |
Re: What does the SalesData class do? Where does the getTotals() method get the value it returns? When is any data put in the sales2 array? | |
Re: > It gives null pointer Look at line 113 and find the variable with the null value. Then backtrack in the code to see why that variable does not have a valid value. | |
Re: > java.lang.ClassNotFoundException: com.mysql.jdbc.Driver The JVM is not able to find the above named class when the code at line 101 calls the forName() method. Find the definition for the missing class and put it on the classpath. It's probably in a jar file. | |
Re: Can you explain how the question is related to java programming. Post the code and the full text of the error messages. | |
Re: Your question leaves out many details. How is the question related to java programming? How is the data stored? How are you reading it? What kind of app is it? What is an authentication error? | |
Re: I don't understand your example. 16000 in hex is 0x3e80 12000 in hex is 0x2ee0 What data is input that you want the following output to create: > 78 00 07 D0 00 00 17 70 00 00 Does the above represent the byte contents in hex? When you talk … | |
Re: Have you tried another FTP program to the same site to see that you have the correct values? | |
Re: Try asking on an HTML forum. This one is for java programming. | |
![]() | Re: You should not be able to directly access private members of a class. The class needs to provide methods that give you any access that the author of the program deems allowable. > I want to know access the "value" of a Card in the "cards" of "pile". What about … ![]() |
Re: The problem could be where to restart the scan. If each line is independent of all other lines, then it might be possible to start the scan on the next line. But if there is nesting of statements, there could be lots of errors as James said. As a student … | |
Re: Post a small complete program that compiles, executes and shows the problem. | |
Re: Can you give an example? The currentTimeMillis() method returns a long representing the elapsed time from a fixed time. | |
Re: > two other bytes that have already been created Where are the bytes that "have already been created"? If in an array and the array is not full, then you need to move all the elements to the right at the insert point. If the array is full, then you … | |
Re: > i want enemy to move closer to player Test if the player is to left (minus) or right (plus) and change the x value accordingly. The player is to the left if its x value is less than the enemy's x value. | |
Re: > stuck when i want to try to put the relation into the two dimension array. Can you define what a "relation" is and how it's value is put into the array? You need to explain what goes into each row and column of the 2D array. |
The End.