| |
| |
| |
|
Page: 1 2 3 4 5 6 7
Comments:
<0> what are the image requirements for the image p***ed to setIconImage? I p***ed it a 16 x 16 gif image and it doesn't show it as the icon, it is just blank <1> how did you load the image? <0> setIconImage( <0> Toolkit.getDefaultToolkit().getImage( <0> "MainMenuICO.jpg")); <1> it could be that the image isn't completely loaded <0> ah <0> I forgot about that <1> use new ImageIcon("MainMenuICO.jpg").getImage() instead <1> or use MediaTracker <0> ok thanks I appreciate it <1> another reason might be thatmaybe the filename is incorrect <1> or the file is not in the current location <0> it is in the current location but I do put everything into a Java ARchive at the end <0> does it mattter <1> yes
<0> and preserve the directory structure <1> then you need to use cl***.loadResource("..") <1> which returns an url <0> ah <0> ok I will look into this <1> http://www.rgagnon.com/javadetails/java-0240.html <0> thank you <0> thank you very much, that worked perfectly <2> Hi. What should command should i include in my code in order to read a Integer typed by the user and save it as an integer (and not a string)? <3> parse the string <2> won't work tried it. <4> what exactly won't work? <3> strange <3> always works for me <2> It turns an exception on <2> wait i'll paste it <3> ok paste it <4> the user inputs sone String. "try { Integer.parseInt(theString); } catch (Exception e) { /* the String wasn't a valid integer */ }" <4> well, for NumberFormatException. I think that's all that can be thrown by parseInt() though <2> http://rafb.net/paste/results/hmTLqh38.html <2> but the problem is that is is. <2> it's just 45 <4> what's all the " " in that paste? <2> but when i try and make it print it all <2> That's the problem... <2> i don't know. <4> paste the code for UDPServer <2> http://rafb.net/paste/results/Bm5Py523.html <2> when i use the System.out.println(clientnum2); command 45 is printed <2> but when i used command to print all the string for {i=0; i<length.string etc. ; i++ } print char(i),string etc. u saw what i got. <2> all those """" <3> well clientnum isn't Integer aferall <4> feels like something is screwy in the datagram <2> i want to make him an integer... <2> How can i detect it though? <4> is the first paste the output of the second? <2> i mean the Datagram is send <2> yes it is <2> u want the ClientAlso? <4> okay <3> what returns num22.getData() ? <3> whick type <3> which <2> http://rafb.net/paste/results/6hyCoJ13.html <4> nesho: getData() returns a byte[] <2> It copys the string as byte array <2> to be send to the datagram <3> aha <3> well u can try to remove all of the empty spaces in string <4> problemJava: replce inFromUser.readLine() in the client with "45" and see what happens <2> smsie :OK just a minute. <2> if u make int num1 = 45; instead of string num1 inFromUser.readLine() <2> it's can't be derefernced <2> to work with the getBytes <4> problemJava: oh, sorry. Use: new String("45"); <2> http://rafb.net/paste/results/vlw4Uu57.html <2> this is what i got for String num1 = "45"; <2> String num2="42" <2> ; <2> OK <2> I'll try new String("45");
<4> ah, I see <4> there's a bazillion trailing spaces <4> 1022 of them I guess <2> same things... for new String("45"); <4> you'll have to strip the spaces out before you can parse <4> yeah <4> you are making the datagram 1024 bytes <4> you're only using 2 of themn <2> http://rafb.net/paste/results/kGzcTG66.html here is the paste <4> the rest are (I would guess) spaces, or perhaps \0 <3> there are \0 <2> Yes but what is somebody uses this to add like 21342356 and 6886879 ? <4> that's fine <2> u think? <4> strip them out in the server <3> make <3> lientnum1,replaceall("\0","") <3> clientnum1,replaceall("\0","") <3> it will return string without \0 <2> where should i put that? <2> Server? <4> yes <3> String clientnum1 = new String(num11.getData().replaceAll("\0","")); <3> try like this <2> OK will do <3> if are spaces <3> String clientnum1 = new String(num11.getData().replaceAll(" ","")); <3> no no <3> mistake <4> might need to use \x00 <3> int zeta1 = java.lang.Integer.parseInt(clientnum1..replaceAll("\0","")); <3> here <4> I;m not sure if it might interpret \0 as an incomplete octal number <3> there is no string <2> wow wait. <2> For starters the clientnum1 = new String(num11.getData().replaceAll("\0","")); didn't work <3> yes <3> my mistake <2> it can't resolve symbol <3> int zeta1 = java.lang.Integer.parseInt(clientnum1..replaceAll("\0","")); <3> this <3> try <2> will do. I 'll try. <3> or <3> int zeta1 = java.lang.Integer.parseInt(clientnum1..replaceAll(" ","")); <4> clientnum1 = new String(num11.getData()).replaceAll("\0",""); should also work <3> yes <3> no <3> can't work <4> why not? <3> it's not string <4> yes it is <3> replaceAll is metod of String <4> yes <2> nope <3> getData is bytes <4> note the two brackets... <4> new String(bytes[]).stringMethod() is legal <3> aha <3> ok <3> did't know <4> new String(bytes[].stringmethod()) is not <3> thank for advice <4> because in the first you're invoking method on a new string, in the second on the byte array <2> it's ain't compiling anyway <2> it says it needs an identifier <4> really? Compiles fine here <4> String clientnum1 = new String(num11.getData()).replaceAll("\0",""); <2> should i use that also? <4> try it <2> both String clientnum1 = new String(num11.getData()).replaceAll("\0",""); and int zeta1 = java.lang.Integer.parseInt(clientnum1..replaceAll(" ","")); ??? <4> I'm not convinced that using just "\0" as a pattern to replaceAll() wilwork, but I've not tried it <4> no <4> one or the other
Return to
#java or Go to some related
logs:
getResoruceAsStream #AllNiteCafe impregnate my mom #php long turds
#mirc lulu26 tits CRAZY FROG dj jing #teens #AllNiteCafe
|
|