1,963 Posted Topics
Re: [QUOTE=Goodboy1;1393285]can u help me with my website please because i do not have any idea how to do or how to start it. if someone knows how to do it please explain for me from the first step until the end please. thanks lot Alex[/QUOTE] If you want someone to … | |
Re: Add some System.out.println calls in your methods and print some debug messages. Add some in your main method. You may also want to print any exceptions that you get. | |
Re: Have you created the database? | |
Re: You can call the checkFP methods in your constructor. Ask the user the values of the tires and then just call the constructor. You can add some more boolean attributes that indicate the condition of the tyres. [CODE] public class TirePressure { private int fright = 0; private int bright … | |
Re: When you call replaceAll why do you use args[0]? That is the argument of your program. You need to remove the number from inside the file. Once you get the line from the file call the split method. Assuming that you have the line: [CODE] String [] tok = line.split(","); … | |
Re: Do you get any errors? Place some debug messages and see what happens. The best thing you can do is print the query that you run and try to run at the database. [CODE] public static void res(int m1) { String dataSourceName = "questions"; String dbURL = "jdbc:odbc:" + dataSourceName; … | |
Re: The count variable will hold the place in which the new coin needs to be inserted. When you add a new coin you will put it in the count place and then you will increase its value by one so the next coin will be inserted at the next element … | |
Re: First of all. You don't need this: [CODE]onsubmit="javascript:return onClick()"[/CODE] The javascript: is used only if want to execute javascript when you click a link. For simple events use: [CODE]onsubmit="return onClick()"[/CODE] Second. You have everything in your first form, but the button that submits it is in another form. You have … | |
Re: Do you know how to run queries using java? Search this forum for examples. Then have in a separate class a method that will run your query and return the data from the DB. Then call that method from the jsp. Once you have tested your method, you can use … | |
Re: You have already been given an answer for this question at this thread: [URL="http://www.daniweb.com/forums/thread323756.html"]http://www.daniweb.com/forums/thread323756.html[/URL] If you didn't like the answer don't double post because you will get the same answer. Follow the steps at the previous thread and do some studying. We are not going to study for you or … | |
Re: Have you tried the simplest thing? Reading the error message that you get! It clearly says: java.lang.ArrayIndexOutOfBoundsException Somewhere in your code you are using an index that is too large or too small. It is like trying to access an array with an index greater than its length. Try reading … | |
Re: For gui interfaces using java there is the JComboBox class. You need to read the GUI tutorials at the sun site, or check the API. For examples search the net or tutorials | |
Re: [QUOTE=Sunshineserene;1383475]Okay I have a problem now. I need to change the way I want it to be. Firstly, I want to read the text file, then store all my numbers in the text file into a 2D array. Secondly, after storing them in a 2D array, then I parse them. … | |
Re: Can you post some code? The best way to do this is not just print the messages, but save the results of the file in a structure. An array or a list. Then loop the list for the display. When the user enters the age then loop again and print … | |
Re: From what you said, you make it sound like that you close the connection when the use logs out; Which is wrong. The rest seem correct, but since your description is kind of vague here is a small suggestion: [B]In a method:[/B] [CODE] { open connection validate username, password given … | |
Re: When the page loads, if you have the color and you set it to the value of the select box then also set it at the row. Can you post the code where you set the selected option of the select box with the color, so we can get a … | |
Re: When you submit to the next page read the value of the radio button and query the database based on that number. Then display the data from the DB. What code did you use to display the radio buttons. I assume that the value of the radio buttons are the … | |
Re: Load all the data of the database into a list of objects. Have a separate method in a separate class that handles the connection with the database and returns that list of objects Then since you have that list, you can display the element of the list. Have a variable … | |
Re: Hasn't anyone thought of using the split method: [CODE] String s = "A- 4"; String [] tok = s.split(" "); // tok[0]: A- // tok[1]: 4 [/CODE] If you have "B 4" then again you will get an array of two elements. Then check the length of tok[0]. If it … | |
Re: You need to post the entire code in order to see where are those variables defined, because if you say that: [QUOTE]if i use the if-else method in the driver class, then it works.[/QUOTE] Then there must be a confusion with what object you instantiate what attributes you are using. | |
Re: [CODE] if (any expression that results to a boolean) { // any code } else if (...) { // any code } else { // any code } [/CODE] That small example means that you can call anything you want inside the if statements. And you can put that if-statement … | |
Re: [QUOTE=Buffalo101;1379505]Sorry to barge in after it's been solved, but with the number being an integer to begin with, you could have written: [code=java] if (number<10) number*=10; [/code] Also, nest your if/else; they way you wrote it: it will test all your conditions. If Number isn't < 10 it most certainly … | |
Re: The doGet method inside witch file/class it is? Because the action in your jsp form must submit to that file. | |
Re: Do you have any requirements or just a title of a project? | |
Re: If you are reading the file line by line, and you are [U]SURE[/U] that each line will have values separated by an empty String then you can use this example: [CODE] String line = "1234 HEDEPT 12-3-2009 12-03-2009 yesno yes A hello@hello.com 12 y12"; String [] tokens = line.split(" "); … | |
Re: [QUOTE=cretaros;1377200] to call another class call its main[/QUOTE] No!! that is wrong. You don't call its main. The main is used only when you run the class, in order to start your program. If you want to call another class, call its constructor. Create a new instance and call its … | |
Re: [QUOTE=cwarn23;1138122]Ok, so I was getting my daily dose of Stargate Atlantis then in the final episode atlantis lands in the atlantic ocean.[/QUOTE] What is amazing is that you watched that show! | |
Re: We are not going to do it for you. And you weren't given this assignment 4 hours ago. I am sure you have been given plenty of time to study and do it. Even plenty of time to come here and ask for help. Had you come here sooner you … | |
Re: You can try this then: [CODE]JScrollPane scrollTable = new JScrollPane(table);[/CODE] And then add the scrollTable to the panel or the JFrame. | |
Re: If you are new in java then this task is not for you. If you had previous experience with jsp then that experience would have been acquired by studying, and you would know what you needed to do: You need to search the net for examples on how to load … | |
| |
Re: Why don't you ask the person whose code you copied? It is obvious that it returns the day. If you want a code that returns the day then write your own and post it here with questions in order to get help. You can use the java.text.SimpleDateFormat class, if you … | |
Re: Edit: Sorry I didn't look the code and what I wrote was not very accurate. This is the code I suggest: [CODE] public class Animal { public void eat() { System.out.println("I eat like a generic Animal."); } public static void main(String[] args) { } } class Fish extends Animal { … | |
Re: [QUOTE=Taywin;1373047]You could use your servlet to display the pagevia your PrintWriter. Just write a string of HTML head and body to it. Try it by writing some html string to the writer first, so you would at least see what would be displayed on the web.[/QUOTE] That is absolutely wrong. … | |
Re: Have you declared a method integerparseInt somewhere? The error was pretty clear. It said it could not find symbol. Symbol: method integerparseInt. Meaning that it could not find the method integerparseInt because it doesn't exist. Try to read more carefully the errors that you get and not just expect others … | |
Re: Your project's description doesn't make much sense. But if you want to start, just create a method that takes as argument the score and by using if statements return the result. Then call that method from the main. Search for examples on how to read input from the keyboard using … | |
Re: What puneetkay is trying to say is that you must first read the input from the console and then do the calculations, not the other way around | |
Re: Does this refer to a web application and JSP? If yes, put an onclick event at the button and then call this: [CODE] window.location.href="your url" [/CODE] For more information read some tutorials here: [URL="http://www.w3schools.com/default.asp"]http://www.w3schools.com/default.asp[/URL] | |
Re: Have a JFrame with a JTextArea and the buttons: Save, Load, Compile, Run. And a way for the user to select a file for loading or saving. (JFileChooser) The user will write his code in the text area and with the buttons you will perform the actions. Save: You will … | |
Re: After a quick look at the API of the JTextField, (which you should always read whenever you have a problem), I found this method: addInputMethodListener. It is inherited by the super class: JTextComponent. I have never used it, but I believe that you should try to add an InputMethodListener to … | |
Re: When you put this in the code: [ICODE]int N=Integer.parseInt(args[0]);[/ICODE] , you are supposed to pass arguments to your program when you run it. (args[0]) Don't expect to copy code from the internet and run it without putting any effort to understand it. Have you tried the link [I]new_programmer[/I] has provided? | |
Re: There are several ways. If you want to keep the code as it is then you can put on click events and change the type to button. You can have 3 different forms with their own submit buttons. Or you can put check-boxes or select-options instead of submit buttons. One … | |
Re: You can try adding a few print messages between your calls in order to see that happens. For example: [CODE] int num = 0; Book[] bookInfo = new Book[num]; System.out.println("Length before Choice1: "+bookInfo.length); Choice1(bookInfo); System.out.println("Length after Choice1: "+bookInfo.length); Choice2(bookInfo); [/CODE] There also is a better design for your problem: [CODE] … | |
Re: Convert the String to an array of characters (look the java String API) Loop the array and for every third element set its value to X (array[i] = 'X') Then convert that array of characters to a new String (look the java String API) [URL="http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html"]http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html[/URL] | |
Re: Create a new array big enough to hold both array's elements and then loop them in order to set their values into the big array | |
Re: No you don't use the lastindexOf I know with arrays. When you say you know how to use that method, which class does this method belong to. Are you referring to the method of the String class? Better explain your problem. As for writing and calling methods there are plenty … | |
Re: The call: "solve(diskNumber-1, Aux, Src, Dst)" will execute after the first call has finished: "solve(diskNumber-1, Src, Dst, Aux)" But don't forget that this is also a recursive call. don't expect this execution: >solve(diskNumber-1, Aux, Src, Dst) >solve(diskNumber-1, Src, Dst, Aux) After the first call the same method will be executed, … | |
Re: [CODE] public void print(){ System.out.println("Address Book Contacts "+contacts[i]); } [/CODE] Where do you define 'i' at the above code? That is why you get the error. Also you will have many [B][COLOR="Red"]Address[/COLOR][/B]es at your program. Meaning that you will have a collection of [B][COLOR="Red"]Address[/COLOR][/B]es. So why do you put the … | |
Re: I would like to add something else. Your first constructor is wrong: [CODE] public ParkedCar(String mk, String mod, String col, String lic, int min) { mk = make; } [/CODE] Here you take the value of make(local attribute) which is null and you assign it to the argument. The idea … | |
Re: [QUOTE=Ezzaral;1049183]Any other homework you need us to provide ASAP on your demand? Perhaps just post your instructor's email address so we can send it in directly?[/QUOTE] Don't give him ideas. Once I saw someone here who actually did posted his teacher e-mail and asked us to send the code there! |
The End.