| |
| |
| |
|
Page: 1 2 3
Comments:
<0> i just need to know which is the popular <1> I've used Hypersonic, MySQL, PostgreSQL, SQL Server, Oracle, and Access. My personal favorite is PostgreSQL. <2> Your Queen is Back <3> uhg. tomcat won't start <3> this is getting frustrating <4> Hey..can somebody please tell me why this is not working (I've explained in the paste): http://www.pastebin.ca/332128
<3> james_mil: what's it doing? <4> It keeps returning the prices WITH the '.0' even when it shouldn't <3> priceIntVal won't end with ".0" because it's an int <3> so every time that runs, it'll run the else statement instead.. appendign the prices double <4> sorry.. <4> hmm <4> evulish.. do you mean I need to change the intValue() method to a doubleValue() method ? <3> er <3> i don't know what you're trying to accomplish, exactly <4> did you read my comments in the paste? <3> oh. then yes, use doubleValue i guess <4> ok i changed that but I got NumberFormatException at this line: int pricesOne = Integer.parseInt(priceIntVal); <3> what are you doing.. <3> why are you changing it to an int <4> because i have a textfield, that allows the user to enter an Int or a Double, and when data is entered, it is added to the ArrayList as a double, so an Int would end in .0 and a Double would end in .1-9. So this if statement is checking if it is an Int or a Double, and I want to display it exactly as the user entered (as an Int or as a Double) <4> hope you understand that <3> what if they entered 20.0? <4> then its an Int <3> but they entered it as a double <4> Yea, but they intended on entering it as 20 - as it is 20.0 - so my program will display 20 <4> hopefully <3> and it won't display exactly as they entered it if they enter 20.0 <4> Yes in that case no it wont...but it will still display 20, which is what i want <4> is my if statement structured wrong?
<3> if (d.doubleValue() == (int)d.doubleValue()) { /* int */ } else { /* double */ } <3> i think that'd work <5> I want to enter 2.0.0 <3> you would! <5> Of course! <5> I like to be difficult. <3> Doubledouble! <4> Thanks evulish :) <6> hello <4> How can i validate a JTextField so it only accepts an Int or Double ? Any methods/tutorials to use? <6> int or Integer, double or Double <4> erm...all of them probably...just NOT a String <6> try { Double.parseDouble(myString)}{catch( NumberFormatException){} <3> try { Double d = new Double(str); } catch (Exception ex) { try { Integer i = Integer.parseInt(str); } catch (Exception e) { return false; } } <6> uh huh <6> there is no need to do it also for the ints <3> oh, good point <4> right thanks <4> so are you saying if NumberFormatException is thrown, then a String has been entered, and therefore an error? Correct? But how do i check if the exception has been thrown or not <3> that's what the catch does <4> oh ye lol <4> :P <4> thanks <3> throw->catch <3> pretty simple analogy there <4> lol yep <4> cheers again
Return to
#java or Go to some related
logs:
#allnitecafe daud abrahim chanes girl in dubai #kl what brothers and indians have in comen notty sms sevemessin sen sosyete35 #php karam dosa
|
|