2,777 Posted Topics
Re: Create a jar file containing all the resources that the program uses that can be copied to other PCs that have the JRE installed. | |
Re: If you just want to see the contents of the array, the Arrays class's toString() method will format a single dim array for printing. Loop through the first dim and pass it to the toString() method to format and print what the toString() method returns. Something like: S.o.p(Arrays.toString(c[i])); | |
Re: > each element is unique from the rest A couple of ways to do this. Before saving the new number, search the previously saved numbers for matches. If the range of numbers isn't too large, used a boolean array to remember what numbers have been saved. Use a Set object … | |
Re: Can you make a small, simple, complete program that compiles, executes and shows the problem? | |
Re: What have you tried? Please post the code showing where you are and ask about any problems you are having. | |
Re: > have no idea how to create this data.dat Do you have a definition of what the bytes in the file contain? Given that you could create the file. | |
Re: For a beginner, Notepad and a command console are recommended. | |
Re: > java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver Where is the definition of the class named in the error message? The JVM can not find it. Do you have a jar file that contains that class file? The jar file should be on the classpath for the java command so the JVM can find the … | |
Re: > java.lang.ArrayIndexOutOfBoundsException: 0 That error says the array is defined with no elements. There is not an element at index 0; You need to define the array large enough to hold all the data you want to put into it. | |
Re: What do you have installed now? What OS are you on? Can you explain what you mean by "setup"? Are you refering to the source code for a program/classs | |
Re: Can you make a small complete programn that compiles, executes and shows the problem? Is the problem with the output that it is missing the line end characters? | |
Re: Can you post a small, complete program that compiles, executes and shows the problem for testing? | |
Re: If youn want to write a java program that creates a jar file, see the JarOutputStream and JarEntry classes. | |
Re: Please start your own thread. This one is one year old. | |
Re: Can you show the input in a java variable and the desired output in hex? Where is the output of the conversion going? Are you writing bytes to a file? | |
Re: > without coding Can you explain how you expect to create a program without coding? Or are you asking how to use some tool that writes code for you? | |
Re: Have you looked at using a Timer? The listener method can change the image's x,y location and call repaint() which will cause the paintComponent() method to be called where the drawImage() method can draw the image at the new x,y location. | |
Re: Where do you call the code to create the JMenuBar? Where do you add it to the JFrame? | |
Re: > the game must wait until the user clicks on a button Look at the JDialog class. | |
Re: > it didn't work Please explain. Show the console from when you execute the program including its output and explain what is wrong with it. One possible problem I see is the code does not use curly brackets to include code in if and while statements. Its best to always … | |
Re: An idea: assign each new word a number and save the numbers representing the words in each line in an array for that line. Comparing numbers should be faster than comparing Strings. | |
Re: > i would like to restart server Does the server have a protocol/message definition that you can use to send it a message telling it to do a restart? | |
Re: I assume most of the sites you are talking about support HTTP. There are some classes in Java SE that would be useful for getting the HTML pages from the sites: HttpURLConnection and there are packages and classes from Apache that would help you. After reading the HTML you will … | |
Re: > Shouldn't narrowing happen implicitly? There could be data lost. The programmer should tell the compiler that he knows what he is doing. | |
Re: Consider that the array reference b[0] can be used the same as the variable b0, b[1] as b1, etc where b is an array of JButtons | |
Re: String str = "asd"; The String: "asd" is referred to by the object reference variable: str. | |
Re: Are you asking how to have one button that when pressed will select the next word towards the top of the list of words and another button that will select the next word towards the bottom of the list? | |
Re: > ,I see no results. Can you make a small, complete program for testing that compiles, executes and shows the problem? | |
Re: Are the class files for the package in a jar file? Is that jar file on the classpath when you compile the program? | |
Re: What class are balance and name defined in? Please post code without the numbers at the start of every line. The numbers make it impossible to do a test compile. | |
Re: > What can you say about the mean and the standard deviation of small town libraries generally? The one in my small town is very pleasant and not a bit mean. I don't think she has any deviations. Don't know about other small towns. | |
Re: > setText(java.lang.string) in javax.swing.text.jtextcomponent cannot be applied to (java.lang.string[][]) The error message says that you are using the wrong argument with the setText() method. It wants a String and you are using a 2Dim String array. You will need to use loops to get the elements out of the array … | |
Re: What is supposed to happen when the code is compiled and executed? Please explain what is shown on the screen. | |
Re: Does the posted code compile without errors? Please copy and paste here the full text of any error messages. Comments on the posted code: 1) there are two classes named: Main 2) the formatting has too much indentation in the last part 3) the }s do not line up vertically … | |
Re: This is not a question that can be answered in a simple post. There are many things that can slow a program down. One tool that can help you find places where the code is executing is a profiler. There are many available, use google to find some. The java … | |
Re: Try testing the code using a very simple input of "ABCDE" Look at the encrypted file and see if it was correctly encrypted. Then decrypt it and see what the output is. This simple test should allow you to easily see the problem. If you need help with this, post … | |
Re: Can you post your code that shows the problem? | |
Re: Your 2800+ line post is unreadable. Please break it up into sections according to its type. Don't put all of the post in as program code. Where is the JListDataListener class defined? | |
Re: > when i add more integer values How many values did you add? The value of the first byte in what you posted went from x1D (29) to x22 (34) Note:00100010 is x22 Since none of the high order(left most) bits are set, your posts each show 4 values. Can … | |
Re: Read the API doc for the JOptionPane class. There is an example there that uses the yes no option. | |
Re: Are you asking for where to look for the code you need? Have you tried Google? Or can you hire a java programmer to write it for you? | |
Re: class files created by version 1.4 should execute in version 1.5 Are you getting any error messages? Please copy and paste them here if you have questions about them. | |
Re: Can you type with normal font, not all caps? All caps is like shouting. Please post the code you are having problems with along with the full text of any error messages and your questions. | |
Re: How is the price of the next soap related to the total cost? How does the price of each soap change? How does the total cost change? | |
Re: You need to look at how to do two things: 1) Read lines from the file. An easy way to do this is using the Scanner class. 2) Split the lines at the comma: See the String class's split() method | |
Re: > how to do the menu system for the game Many people print out the user's options, read in the user's response and use a switch statement to control what the program does. | |
Re: Can you post the code you are having trouble with? | |
Re: Variable names used in a program are created when you edit the program. If you want to assign a name to a value at execution time, use a Map<String, Value> where Value is the class to hold the value associated with the name (a String). |
The End.