2,777 Posted Topics
Re: The names of variables are defined when you use the editor to type them in. | |
Re: Please create a small, simple program that compiles, executes and shows the problem. Hard to test code that does not execute. You can leave out the parts the are not relevant. Have you tried debugging the code by adding printlns to show how the variables change as the code is … | |
Re: Please explain what your problem is. Copy and paste the full text any compiler errors here. Please edit your post and wrap the code in code tags. Use the [code] icon above the input box. | |
Re: [QUOTE]he applet does not work with tcp[/QUOTE] please explain. What classes are you using? Are you trying to connect to a site that requires permission? | |
Re: [QUOTE]comes up with a bunch of errors [/QUOTE] Please copy and paste the error messages here. [CODE]Interface.panel.[/CODE] The syntax of that statement says the panel is a static variable in the Interface class. If panel is not static, you get an error message. Your use of java class names: interface … | |
Re: [QUOTE]it is not cropping the actual part which we selected.[/QUOTE] Is it a problem mapping the selection coordinates to the image's coordinates? Do you need to consider the image's location on the screen to find the coordinates within the image? Print out the coordinates for the mouse and for the … | |
Re: [QUOTE] it isn't working[/QUOTE] Can you explain what the program does and what is wrong? Try debugging the program by adding println statements to show the values of variables as they are used and changed. The print out will show you what the program is doing so that you can … | |
Re: How many Mang objects does the code create? How many should it create? Add a println in the Mang constructor to print a message. | |
Re: An idea: Connect to the socket so the accept method returns and then have the code exit the thread. | |
Re: What does your code currently print out and what more does it need? Can you paste here the program's current output? | |
Re: [QUOTE] make the server and all the other clients receive the message [/QUOTE] The server could forward the message it receives to all the clients that are connected to it. If there is a list of clients, you could have some selection criteria to choose which one(s) to send any … | |
Re: [QUOTE] java.lang.NullPointerException at FatGramsPanel$FatListener.actionPerformed(FatGramsPanel.java:54)[/QUOTE] What variable has a null value on line 54? Then why is its value null? Do you know the difference between local and class variables and that local variables will shadow the class variables? Check that you have not defined any variables in two places: class … | |
Re: Can you make a test program without the third party packages? | |
Re: Swing classes use double buffering. I you use a JPanel class, override the paintComponent method for your drawing and add that to the applet, the flickering could go away. | |
Re: Post your code if you want help with it. | |
Re: [QUOTE] method class to read the getText from my GUI class?[/QUOTE] You would need a reference to the GUI class in the method class that you could use to call the GUI class's getText() method. String someText = refToGUIClass.getText(); | |
Re: What is the java program supposed to do? What is a record file? Start by reading the tutorials: [url]http://docs.oracle.com/javase/tutorial/reallybigindex.html[/url] [url]http://docs.oracle.com/javase/tutorial/java/TOC.html[/url] | |
Re: Try changing it in the other place. Leave the method definition as it was and change what you pass to the method to be a Triangle object. Create a Triangle object from the variables: b,h, etc and pass that to the addTriangle method. | |
Re: [QUOTE] update the file on a regular interval,[/QUOTE] Look at using the Timer class. It can call your update method on a regular interval. | |
Re: Can you Describe what you mean by a feature? Are you reading an image from a database and want to know its size? | |
Re: What is the value of the classpath when you try to compile the program? The classpath should contain the folder that contains the start of the package path. The classpath plus the package path should point to the class file. There should not be any overlap between the two paths. | |
Re: Please show the String you have as input and what you want the output to be. The methods split or indexOf and substring could be useful for extracting parts of a String. Post the code that shows how you are trying to solve the String parsing problem. | |
Re: Can you post what the program's current output is? Why does the "proper way" contain a comment on line 3? | |
![]() | Re: [QUOTE]What is wrong with my code?[/QUOTE] Can you explain what the problem is? Does it compile? Does it execute? What are the results of the execution? Please post the output and explain what is wrong with it. ![]() |
Re: [QUOTE]need a complete code for a car class with the following attributes;[/QUOTE] Have you asked Google? You have a better chance of getting it there than here. ![]() | |
Re: Duplicate post at [url]http://www.daniweb.com/software-development/java/threads/414871[/url] | |
Re: Where does the code get the image from? Where do you want to show the image? Why are you using the Scanner class? | |
Re: Is this the same problem? [url]http://www.javaprogrammingforums.com/algorithms-recursion/14155-sorting-strings-new-post.html[/url] | |
Re: What does a list of Strings have to do with monitoring Threads? | |
![]() | Re: You need to add some code to the main() method. The java program starts the program's execution by calling that method. Your program would immediately return without doing anything. ![]() |
Re: It will be much easier for anyone to help you if you write a small simple program that compiles and executes with the code that you want to have rotate an image. Most of the code you posted has nothing to do with rotating an image. | |
Re: Sounds like an algorithm/logic problem. If you have the algorithm, and have specific questions about how to implement it in java, please post your questions. Can you list the steps in solving the problem and where you are having the problem. | |
Re: Are you asking for the information that would be shown in a variable cross reference listing if the compiler were to generate such a thing? You'd need a java language parser to scan the source and generate a cross reference. | |
Re: [QUOTE]what method do i need to use for the alphabetical order[/QUOTE] You are using the method: compareTo that I would suggest. Can you explain what your problem is with the program? | |
Re: Define the Scanner variable outside of the method and assign it a value in the method where you can wrap it in a try/catch block. | |
Re: Please edit your post and wrap the code in code tags. Use the [CODE] icon above the input box. [QUOTE]i need to generate the random number [/QUOTE] See the Random class for a way to generate random numbers. | |
Re: Put the loop around the code that asks the user for input and gets his responses. Try it a few ways and change it if it doesn't do what you want. Do some experimenting to see where the best place is to put it. Please edit your post and wrap … | |
![]() | Re: I'd add a call to printStackTrace to the catch block line 43 to show the full text of the error message. |
Re: [QUOTE]some compiler error.[/QUOTE] Can you copy and paste here the full text of the error messages? It has important information about your problem. Have you read the API doc for the Java SE class Iterator? The compiler doesn't think the class has the method you are trying to use. | |
Re: A main difference between using console I/O with a user and a GUI is that the program doesn't ask a question and wait for the response in the same way. With GUI the program shows a screen with the question and some input areas and buttons that the user can … | |
Re: What does the FTP server do when your program connects to it and sends it instructions and data? Are there any error messages? What packages are you classes in? You don't show the import statements for the code. | |
Re: First thing you need is a list of all the steps the program needs to do to solve the problem. So make a list of the steps. When you have them, then take them one at a time and figure out how to write the code in java to do … | |
Re: It works for me. I see a vertical dividing line between the two JTextFields. Try typing something into the text fields. Try putting a String into them in the constructor. | |
Re: What tutorials have you read? Go read the API doc for the wait and notify methods of the Object class. There is a discussion of Threads and monitors there. For learning how to use synchronized and threads, you should write a simple program to use those features. The code you … | |
Re: [QUOTE]java.lang.NullPointerException PageCount.doGet(PageCount.java:24)[/QUOTE] Look at line 24 and find the variable that has a null value. Then backtrack in the code to see why that variable does not have a non-null value. If null is valid value, the you test for it before using the variable. [CODE]if(name=="myid")[/CODE] Use the equals() method … | |
Re: Do you have any questions or problems? Please ask or explain. | |
Re: [QUOTE]puzzle.toString().substring(11)[/QUOTE] What is the String that is returned by that call to substring? For debugging, get that String into a separate String variable and print it out so you can see what the program is doing. Be sure to add delimiters on each side of the String so you can … | |
Re: You don't show what is printed out by the program. Showing the output would be helpful in determining the program's problems. | |
Re: Do you have a question? | |
Re: Can you post what the correct answer should be? Try debugging your code by adding println statements to show the values of all the variables that are used, print them out every time their values change. Use an id String with the print out so you know what is printing: … |
The End.