2,777 Posted Topics
Re: Are you executing the applet in a browser? Are there any error messages in the browser's java console? | |
Re: You should put all the files needed for your applet into a jar file and use the class loader's getResource method to get to the file so it can bee read. Do a Search here for getResource for example code. | |
Re: >code is giving error Please post the full text of the error message. | |
Re: Assign r a value and make the compiler happy. The compiler wants you to assign initial values to local variables (inside methods) | |
How you you make a comment using the new forum? Half the time my text following the comment is included in the shading for the comment. The mechanism for adding a comment seems awkward. On many other forums you could click a button, paste the comment and click the button … | |
Re: Is the path shown in the error message correct? Is that where the JDK is installed? | |
Re: Would servlets do what you want? | |
Re: [QUOTE]how can I make the label movable after it's been created[/QUOTE] The mouse motion listener will help you with that. It takes some playing with to get it to move smoothly but its possible. | |
![]() | Re: > write the frist line but how to write the whole string? What do you mean by a line and a String? Can you define what the difference is between those two terms? What do you use to view the contents of the output file? ![]() |
![]() | Re: What do you mean by: > Quoted Text Here write it to binary Can you give an example? ![]() |
Re: Do you have any questions or problems? | |
Re: Define an int as a counter, then add one to a counter every time a new number is entered. Look at about line 16 to do this | |
Re: Do you have any java programming questions? | |
Re: Can you reference the lines of code where you are having problems with the logic? Where in the 195 lines of code it the problem? | |
Re: > Why am i getting error Please copy and paste the full text of the error message. | |
Re: > my program throws an error Please post the full text of the error messsage. | |
Re: One potential problem with the way this is coded is that you have not used {}s for the statements in the if and else parts. This can often cause problems that are hard to see. | |
Re: Where there any error messages in the browser's java console? | |
Re: Can you show the debug print out when the problem happens? Add enough more println statements to show the values of all the variables as they are used. | |
Re: Have a look: [Link Anchor Text](http://docs.oracle.com/javase/tutorial/java/concepts/class.html | |
Re: Start by writing a program that just creates one square. Then look at how you can change it to make the next square. | |
Re: I don't see any static classes here, Do you mean static variables? Why are you using static variables? > I was expecting to see different values You only get different values (one per class instance) with non static variables. With static variables all instances of a class share one variable. | |
Re: Can you post the output that shows the problem and add some comments to it that explains what is wrong with it and that shows what the output should be? | |
Re: Is the JPanel added after the GUI is made visible? Try calling setVisible after adding the JPanel. | |
Re: Try debugging your code by adding println() statements to show execution progress and how variable values are changing. For example: Add a: System.out.println("var=" + var); after every line where a variable is changed by an assignment statement or read into. The printout should show you in what order the methods … | |
Re: If you use the read() method, you can test every byte that is read to see if its one that you want to print. Please wrap your code in code tags. Use the `[code]` icon above the input box. | |
Re: What does the text file contain? If it has a record with two Strings that are the row and column values, you could use the Scanner class to read and convert those two Strings into int values. If you read the whole line as a String then you will need … | |
Re: [QUOTE] its coming up with errors[/QUOTE] Please copy and paste here the full text of the error messages. | |
Re: What kind of protocol do you have? Does the client connect to the server and request a file or does the server choose what file(s) it is going to send? If the server is going to send more than one file, does it tell the client how many files it … | |
Re: What hashmap methods have you tried? | |
Re: Use a for loop to look at the numbers one at a time and save the largest ones. If you are saving the indexes and there can be more than one, you will need another array to save the indexes in. | |
Re: If you don't need an inner class, make MyClass static. | |
Re: The "cannot find symbol" message is telling you that the compiler can not find a definition for the symbol named in the error message that is defined in scope where the symbol is being referenced. For each one you need to see why you are using a symbol that is … | |
Re: Don't call setVisible until all the GUI has been layed out. | |
Re: Override the JPanel class's paintComponent method and do the drawing there. You can make the drawing conditional on values set by other methods the the program, | |
Re: Can you post the code that is generating a random number with the value of 0 | |
Re: What line is the NPE on? What variable has a null value? Add a call to the printStackTrace method to get the full text of the error message. | |
Re: [QUOTE]My current shape selection disappears[/QUOTE] How would clearRect change a selection? You have not posted enough code to tell what the program is doing. | |
Re: The code that reads the file needs to save the Strings it reads in an array or arrayList so that they can be sorted after they are all read in. The problem with an array is that it must be defined large enough to hold all the Strings you want … | |
Re: How are you going to use a java program for this project? There are many algorithms for hashing a String. Have you researched one that looks good for you? By hashCode are you referring to what is returned by the Object class's hashCode() method? | |
Re: If you know the client that sent the message and have a reference to it, then use that reference as you send the messages to the clients in the list to skip over the client that sent the message. I assume that you have a list of connected clients and … | |
Re: What is a "linked file"? What is the format of the bytes in the file? If you can get the path to the file, you can read its contents in a java program. But you will need to know the format of the bytes in the file to extract any … | |
Re: 2D arrays are really an array of arrays. If you think of a 2D array in row and column terms, each row can have a different number of columns, including 0. For example:[CODE] int[][] twoD = new int[5][]; // Define 2D array with 5 rows, leave # columns undefined twoD[0] … | |
Re: If you don't want repeats, then you will need to keep track of what has been read so far, and skip reading that one again. If the number of records are known, you could use a boolean array to keep track of what has been read. | |
Re: You could create a batch file that executes the jar with a DOS window. Leave the window open when the java program finishes: use MORE. The contents of the DOS window could be copied and saved. To copy the contents of the command prompt window: Click on Icon in upper … | |
Re: Where will these pairs of numbers come from? A file or via user input? If the numbers don't change often, then you could read them from a file that a user could fill in using an editor. If there are two numbers that go together, you could create a simple … | |
Re: Please explain what your problem is. Please edit your post and wrap the code in code tags. Use the [CODE] icon above the input box. | |
Re: Please post the full contents of the window showing all of the error message text. To copy the contents of the command prompt window: Click on Icon in upper left corner Select Edit Select 'Select All' - The selection will show Click in upper left again Select Edit and click … |
The End.