1,963 Posted Topics

Member Avatar for achieve_goals

[QUOTE=achieve_goals;1184342]Actually I have to make a hashtable. My data is in a datafile and I have to retrieve data from that without using Java Class Library, that means I cant use import java.io... I have to take first two words to be the key and then the next word to …

Member Avatar for achieve_goals
0
94
Member Avatar for jtodd

Post your error messages. Also you have a method: [B]setRadius[/B] Why don't you use that instead of this: myCircles.radius = input.nextDouble() What's the point of having it?

Member Avatar for jtodd
0
142
Member Avatar for oggiemc

You are using something which is null. The error tells you the line where that happened. Also you are trying to close the 'stmt' variable but you are using the 'pstmt' to execute the query.

Member Avatar for oggiemc
0
238
Member Avatar for anjal_pawar

2 for loops. Outer: 1 to 5 for the lines. Inner: Depending on the index of the first loop you will decide how many stars will be printed. The number of stars will be the number of times the inner loop will run. Also: [B]System.out.println()[/B] : Changes lines [B]System.out.print("*")[/B] : …

Member Avatar for javaAddict
0
247
Member Avatar for ben1

You haven't given us much to work with. You might want to create a "Food" class. Maybe you should also create subclasses of the "Food" class for different foods. And perhaps different foods can be inputted in specific types of machines so you have some business logic here. Have a …

Member Avatar for ben1
0
145
Member Avatar for aomran

[QUOTE=aomran;1182259]the only way to kill it is to inter a character and not an integer. sc.hasNextInt() suppose to return a boolean true if the next token is an integer and false if anything else [B]including eol.[/B] [/QUOTE] Well apparently the last part is not correct. I just checked the API …

Member Avatar for javaAddict
0
240
Member Avatar for music_est_vie

Assuming that their files are classes with methods, then in your swing class, you will have instances of those classes. Then according to what the user clicks you will call the methods of those classes and display the results. If those classes have main methods, then they are doing it …

Member Avatar for javaAddict
0
170
Member Avatar for aditya_22cent

First of all, write a main method in a separate class and test the ParseClean in order to see that it works. Then post some more code of the a.html file so we can see how you submit the form. And finally don't use this: [ICODE]out.println(ch.ParseClean(trans));[/ICODE] Use this: [CODE] <%@page …

Member Avatar for javaAddict
0
135
Member Avatar for albertkao

The NumberFormatException tells you that what you used as argument is not a number. It also says that the value you passed is the String: undefined [QUOTE] threw exception java.lang.NumberFormatException: For input string: "undefined" [/QUOTE] That would mean that the value of rowsPerPageStr is the String: "undefined": [ICODE]String rowsPerPageStr = …

Member Avatar for javaAddict
0
425
Member Avatar for samrin

[QUOTE=sweety roy;1181095]* *** ***** *** * display the output as above using c++ or c[/QUOTE] This is a java forum. Start a new thread in the C forum but don't expect people to give you the answer if don't show some effort and post what you have done so far.

Member Avatar for javaAddict
0
171
Member Avatar for chern4ever

Use the equals method to compare Strings: [CODE] temp2.equals("/") [/CODE]

Member Avatar for javaAddict
0
109
Member Avatar for artanbori

First of all don't do this: [CODE] public Card() { Card card = new Card(); } [/CODE] When you try to create an object you will call the constructor. Inside it you call this: [ICODE]Card card = new Card();[/ICODE], which will call the constructor, but inside it you call this: …

Member Avatar for artanbori
0
310
Member Avatar for johndoe444

[CODE] public class testAssert { public static void main(String[] args) { int x = 5; int y = 7; boolean b = x!=y; System.out.println(b); } } [/CODE]

Member Avatar for johndoe444
0
198
Member Avatar for zyaday

Because the [ICODE]x.substring(0,200)[/ICODE] throws a StringIndexOutOfBoundsException not a TryCatchException1. If things worked the way you thought then when people do this: [CODE]try { } catch (NumberFormatException e) { } catch (SQLException e) { } catch (Exception e) { } [/CODE] Then the other exceptions will never be caught and everything …

Member Avatar for BestJewSinceJC
0
113
Member Avatar for kut KK

Write if statements. Have a method that takes as argument what you want and return the other. You say that the uses enters the grade and expects to see the grade point [CODE] public void nameTheMethod(Stirng grade) { if ("A".equals(grade)) { System.out.println(4.00); } else if ("A-".equals(grade)) { System.out.println(3.7); } else …

Member Avatar for Nick Evan
0
130
Member Avatar for jrlynch1

[QUOTE=vchandra;1175595]like that it will not set the file path correctly. so instead of File inuse = new File(temp) you need to write File inuse = new File("c:\\test\\"+temp) cheers[/QUOTE] [I]vchandra[/I] is right. Also it is a good thing always to check the API of the classes you are using. Why did …

Member Avatar for jrlynch1
0
87
Member Avatar for uptheirons1

First of all always use {} brackets. Look what you wrote: [CODE] if(arg == "Exit") System.out.println("Program Terminated."); System.exit(0); [/CODE] And what I wrote: [CODE] if(arg == "Exit") { System.out.println("Program Terminated."); System.exit(0); } [/CODE] In your first code, if the [U]if statement[/U] is true it will execute only the [B]System.out.println("Program Terminated.")[/B] …

Member Avatar for uptheirons1
0
534
Member Avatar for Riddlekid

At the btnOkActionPerformed whenver the button is clicked, you read the file and the you add the new DVD to the list. It is not necessary. You need to read only once the file and sotre those value at the list. Of course I don't know the purpose of that …

Member Avatar for javaAddict
0
90
Member Avatar for bufospro

You throw it, but you don't catch it. Exceptions tend to terminate your program in a bad way. You need to catch them so that it won't terminate your program: [CODE] public static void main(String args[]) { A a = new A(); int x1; int x2; x1 = 7; x2 …

Member Avatar for bufospro
0
161
Member Avatar for zyaday

This code: [ICODE]private Employee e = new Employee("ME","MYSSN");[/ICODE] calls the constructor. [CODE] public class Employee { [B][COLOR="Red"] private Employee e = new Employee("ME","MYSSN");[/COLOR][/B] public Employee(Employee e){ this(e.name,e.SSN); } [/CODE] When the constructor of a class is called you create an instance of that class and its attributes are declared and/or …

Member Avatar for zyaday
0
121
Member Avatar for justinlee23

Probably because in the while loop you have code that sets the balance to the initial amount. Put that piece of code outside the loop. I think that it happens here: ca.setInitial(checkingAmt) . You keep asking for the user to enter initial amount in the loop.

Member Avatar for javaAddict
0
130
Member Avatar for funjoke88

Why, have you given any effort? In the entire thread, vchandra has been given you the answer even though it is against the forum rules. You have showed no effort from your part. You just took the code, run it, and report back what you didn't like in order to …

Member Avatar for javaAddict
0
129
Member Avatar for paradiseis

Then post what you have done so far. The code that there is in the txt is not complete and doesn't compile. You are missing the closing brackets

Member Avatar for javaAddict
0
141
Member Avatar for amby

Are you getting compile error? I am not familiar with C#, but If we assume that the concatenation works the same then maybe this is the problem: This: [CODE] <script type="text/javascript" src="<%=ResolveUrl"jquery.js"%>"></script> <script type="text/javascript" src="<%=ResolveUrl"JScript.js"%>"></script> [/CODE] Should be like this: [CODE] <script type="text/javascript" src="<%=ResolveUrl + "jquery.js"%>"></script> <script type="text/javascript" src="<%=ResolveUrl + …

Member Avatar for amby
0
198
Member Avatar for sana.malik

[CODE] p.println ("This is written to a file"); [/CODE] That is what is written to the file. I can't understand what is the problem. It writes whatever you want it to write. If you want something else written then put whatever you want written in that code: [CODE] p.println ("This …

Member Avatar for rue64ja
0
79
Member Avatar for AngelPriya
Re: PLS

[QUOTE=AngelPriya;1174560]K ILL NOT REPEAT THIS AGAIN....Send me d coding...[/QUOTE] Repeat what? Where are you having problems with and [U]what is your question[/U]? Just because you send me [B]3 PMs[/B] it doesn't mean that everybody can read my messages and [U]nobody knows your question[/U]. And hijacking an old 1-year old thread …

Member Avatar for javaAddict
0
155
Member Avatar for vij123

Your question doesn't make much sense but I will give you an example in case it helps: PAGE 1: [CODE] <a href="page2.jsp?name=someSchool&address=someA&number=11">Link in page 1</a> [/CODE] PAGE 2: ([B]page2.jsp[/B]) [CODE] <% String name = request.getParameter("name"); String address= request.getParameter("address"); String number= request.getParameter("number"); %> <a href="page2.jsp?name=<%=name%>&address=<%=address%>&number=<%=number%>">Link in page 2</a> [/CODE] Inside the …

Member Avatar for vij123
0
1K
Member Avatar for juliesyumyum

It is because you enter to the stack character by character: [CODE] theStack.push((int) (ch - '0')); [/CODE] Meaning that this input: 10+2, will be entered in the stack like this: 1, 0, +, 2 You want this: 10, +, 2 Try this: [CODE] String s = "10+2-3/4*11"; StringTokenizer st = …

Member Avatar for javaAddict
0
208
Member Avatar for spiritsad

After reading the requirements they are pretty big, but most of all pretty explanatory. And given the introduction, I don't believe that you are required to do them all at once. So at which point are you having problem with. What do you need to implement at first. The pdf …

Member Avatar for javaAddict
0
92
Member Avatar for peterwalter

If I understood correctly your problem I think that you lack the basic of Maths. I assume that a PolynomialTerm is this: aX^b: 4X^3. If x=2 then the above would be: 4*(2*2*2) = 32 Then the addition can only be done only when the exponents are the same. You cannot …

Member Avatar for javaAddict
-1
100
Member Avatar for afruja

[QUOTE=afruja;1169298]i want to disable forward and back button of IE in jsp page[/QUOTE] Perhaps it would be better to tell us WHY you want to disable the forward/back button. Maybe what you are trying to achieve can be done in another way than disabling the buttons.

Member Avatar for jwenting
0
271
Member Avatar for jenjenjenjen

[CODE] [COLOR="Green"][B]Scanner scan = new Scanner(System.in);[/B][/COLOR] //enter 10 scores String score = ""; for (int i = 0;i<= scores.length-1;i++) { try { System.out.println("Enter Score " + (i+1) + ": "); [B]s[COLOR="Green"]core = scan.nextLine();[/COLOR][/B] scores[i] = Integer.parseInt(score); } catch(Exception e) { System.out.println("Value entered: "+score+" is not a number"); System.exit(1); } } …

Member Avatar for vchandra
0
88
Member Avatar for nickoclews

It means that such a constructor doesn't exist. Look at the Employee constructors. What do they take as argumentand what does the [B]myStore.elementAt(i)[/B] return? [CODE]u=new Employee(myStore.elementAt(i)); [/CODE] Also shouldn't you be doing this: [CODE] u=(Employee)myStore.elementAt(i); if(txtName.getText().equals(u.name)) { txtName.setText(u.name); txtPhonenum.setText(u.phoneNo); txtNi.setText(u.natInsceNo); } [/CODE]

Member Avatar for javaAddict
0
99
Member Avatar for lrolsto1

[QUOTE=mytime19;1170694]try this [CODE] public class Battleship{ public static void main(String[] args){ int boardInput = Integer.parseInt(args[0]); } }[/CODE] Cheers[/QUOTE] That is correct, but I would prefer something like this: [CODE] public class Battleship{ public static void main(String[] args){ if (args.length>0) { int boardInput = Integer.parseInt(args[0]); } else { System.out.println("No arguments given"); …

Member Avatar for lrolsto1
0
123
Member Avatar for lion hunta

Just create the labels, buttons and textfields like the example. Check the API for what you need to use. When the radio buttons are clicked get the value of the text field like the example. Look the API of the JRadioButton and see what Listener to use. Use the getSource() …

Member Avatar for javaAddict
0
90
Member Avatar for David22

Try to print it and then run it to an sql client or an sql editor and see what is the problem: [CODE] .. String query = "INSERT INTO WeatherHistory (Date, Location, Overview, Temperature, WindDirection, WindSpeed, Pressure) VALUES ('"+date+"','"+location+"','"+temp+"','"+windDir+"','"+windSpd+"','"+pressure+"')"; System.put.println(query); prepStat = connection.prepareStatement(query); [/CODE] Take what is printed and run …

Member Avatar for csjbot
0
99
Member Avatar for unique88

In a separate class or in one of the ones you already have, put that method: [CODE] public static void main(String [] args) { // instantiate objects and call their methods } [/CODE] Inside it you will put the code that you want executed. Then you will run the file …

Member Avatar for javaAddict
0
179
Member Avatar for dat_geezer

I don't know if it can be done but instead of using the ActionListener interface, you can use the MouseListener interface. Check the API of the JButton to see if it can accept such a listener. If yes, then look at the methods that it has. Also when you drag …

Member Avatar for javaAddict
0
91
Member Avatar for unique88

Have you defined a Connect4Column class? Also I have given suggestions in the other thread which you didn't follow. (About the ';'). The constructor seems ok though. If it is the same as before then I must have missed something. Next time use Code tags. Press the button: (code) when …

Member Avatar for unique88
0
137
Member Avatar for unique88

Look at this: [CODE] Connect4Model(int numCols, int numRows); constructor { [/CODE] You have a semicolon after the parenthesis. It means that you ended the command there and the rest: [ICODE]{...}[/ICODE] are not inside the constructor. Don't use ';' at the declarations of methods. In methods like this: [ICODE]int getCounter(thisColumn, thisRow)[/ICODE] …

Member Avatar for javaAddict
0
107
Member Avatar for pradeep2010

After you call the second query, do you check if there were any rows returned before calling the rs.getString ? [CODE] // Maybe you should do this: rs1.close(); rs1 = st.executeQuery(ssql2); // And this: if (rs1.next()) { buffer = rs1.getString("balance"); } [/CODE] You also don't close the rs, the st …

Member Avatar for javaAddict
0
208
Member Avatar for justbelieve87

The method createInvoiceItems is declared inside the class ProcessInvoice class. But you are doing this: [ICODE]invoice.createInvoiceItems()[/ICODE] The Invoice class doesn't have the createInvoiceItems method the ProcessInvoice has. Also I don't think it can be called from outside the class ProcessInvoice if it is private. Also I suggest that you initial …

Member Avatar for tiny7415
0
167
Member Avatar for Aissi
Member Avatar for javaAddict
0
73
Member Avatar for pateldeep454

Where are you having problems? Reading the file or doing the formula. The above are 2 different things. First write a method that reads a file and returns a double array. I assume that all data in the file have 10 seconds difference. [CODE] public double [] read(File file) { …

Member Avatar for javaAddict
-1
760
Member Avatar for jenjenjenjen

This '%' gives the remainder of a number. An even number is the one that can devided by 2 so the remainder of 2 should be 0: [CODE] if (number%2==0) { System.out.println("Number: "+number + " is even."); } [/CODE]

Member Avatar for mytime19
0
128
Member Avatar for niranjancs

The link can be: [CODE] <a href="somepage.jsp?param1=aaaaa&param2=3333&param3=123">Link 3</a> [/CODE] And at the somepage.jsp, you can do this: [CODE] String a1 = request.getParameter("param1"); // aaaaa String a2 = request.getParameter("param2"); // 3333 String a3 = request.getParameter("param3"); // 123 [/CODE]

Member Avatar for javaAddict
0
75
Member Avatar for StephNicolaou

I don't think you can edit that. It is very difficult to do it and since it is auto generated you shouldn't. Better start over. I prefer not to use the GUI builder because it does not allow to create dynamic gui components (a variable number of buttons during run …

Member Avatar for StephNicolaou
0
110
Member Avatar for Tarli14

[QUOTE=jwenting;1168831]Never read more in the specs than they state. The specs state to output that text to screen, so that's what you write. What the author of the specs intended has nothing to do with that, if they signed off on that document, that's what they get unless they pay …

Member Avatar for javaAddict
0
88
Member Avatar for Katana24

Take a look at your brackets. Always use them. You are suppose first to check the input and then calculate: [CODE] for () { if (not a digit) { return false; } } // if the above code didn't return then the input is OK [/CODE] But you do this: …

Member Avatar for Katana24
0
84
Member Avatar for eshirley

After looking at the other post with the same question, please [I]eshirley[/I] answer me this. Why didn't you post the code you posted here to that thread. In general why didn't post the entire first post of this thread to that. It would have been acceptable. You asked for a …

Member Avatar for Katana24
-2
99

The End.