1,963 Posted Topics

Member Avatar for ladylove

[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 …

Member Avatar for javaAddict
0
865
Member Avatar for hanaa5h5

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.

Member Avatar for hanvyj
0
133
Member Avatar for spring_patel
Member Avatar for muncher10

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 …

Member Avatar for jon.kiparsky
0
89
Member Avatar for javaperson1

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(","); …

Member Avatar for javaAddict
0
153
Member Avatar for neo_31591

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; …

Member Avatar for neo_31591
0
123
Member Avatar for wowz

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 …

Member Avatar for javaAddict
0
102
Member Avatar for theo23

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 …

Member Avatar for javaAddict
0
174
Member Avatar for Kunal Lakhani

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 …

Member Avatar for javaAddict
0
97
Member Avatar for nikita.chandra

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 …

Member Avatar for peter_budo
0
104
Member Avatar for edwardlee2708

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 …

Member Avatar for peter_budo
0
356
Member Avatar for Pushpasheela

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

Member Avatar for jon.kiparsky
0
189
Member Avatar for Sunshineserene

[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. …

Member Avatar for Sunshineserene
0
2K
Member Avatar for minimi

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 …

Member Avatar for javaAddict
0
188
Member Avatar for sureshksk

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 …

Member Avatar for javaAddict
0
77
Member Avatar for vij123

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 …

Member Avatar for javaAddict
0
303
Member Avatar for reshmajohney

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 …

Member Avatar for reshmajohney
0
216
Member Avatar for nikita.chandra

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 …

Member Avatar for javaAddict
0
257
Member Avatar for soccer13

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 …

Member Avatar for apines
0
8K
Member Avatar for plasticfood

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.

Member Avatar for Taywin
0
136
Member Avatar for RaghadAsfar

[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 …

Member Avatar for javaAddict
0
79
Member Avatar for Protoroll

[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 …

Member Avatar for Buffalo101
0
106
Member Avatar for rahullao

The doGet method inside witch file/class it is? Because the action in your jsp form must submit to that file.

Member Avatar for javaAddict
0
105
Member Avatar for pRincezZ_fe
Member Avatar for kvkc

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(" "); …

Member Avatar for javaAddict
0
206
Member Avatar for 080346

[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 …

Member Avatar for javaAddict
0
4K
Member Avatar for cwarn23

[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!

Member Avatar for dexter737
0
203
Member Avatar for ITmajor

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 …

Member Avatar for peter_budo
-2
137
Member Avatar for Pushpasheela

You can try this then: [CODE]JScrollPane scrollTable = new JScrollPane(table);[/CODE] And then add the scrollTable to the panel or the JFrame.

Member Avatar for kramerd
0
136
Member Avatar for saisakthi

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 …

Member Avatar for javaAddict
0
892
Member Avatar for javanerd21
Member Avatar for aappee

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 …

Member Avatar for aappee
0
140
Member Avatar for rje7

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 { …

Member Avatar for javaAddict
0
170
Member Avatar for Razultull

[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. …

Member Avatar for Razultull
0
154
Member Avatar for Javagirl2010

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 …

Member Avatar for javaAddict
0
250
Member Avatar for honeybunch16

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 …

Member Avatar for javaAddict
-1
174
Member Avatar for dnmoore

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

Member Avatar for princeandzoe
0
446
Member Avatar for funlove201

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]

Member Avatar for cale.macdonald
0
144
Member Avatar for indrasmission

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 …

Member Avatar for indrasmission
0
108
Member Avatar for miraj0072004

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 …

Member Avatar for javaAddict
0
257
Member Avatar for JanineXD

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?

Member Avatar for javaAddict
0
354
Member Avatar for Claude2005

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 …

Member Avatar for javaAddict
0
118
Member Avatar for EEETQ

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] …

Member Avatar for EEETQ
0
140
Member Avatar for oling

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]

Member Avatar for javaAddict
0
90
Member Avatar for manosha

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

Member Avatar for javaAddict
0
56
Member Avatar for llocks

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 …

Member Avatar for javaAddict
0
97
Member Avatar for flyingcurry

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, …

Member Avatar for flyingcurry
0
134
Member Avatar for blackeyedanel

[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 …

Member Avatar for javaAddict
0
4K
Member Avatar for deleti0n

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 …

Member Avatar for javaAddict
0
114
Member Avatar for endsamsara

[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!

Member Avatar for Weixing
-1
5K

The End.