| |
| |
| |
|
Page: 1 2
Comments:
<0> Greetings, #java <1> Morning <0> I've put my first image onto a JFrame a few days ago, and up to date I've managed to get it nicely into a JScrollPane.. <0> Everything is working perfectly... moving.. sizing.. and so on <0> But now I would like to translate the virtual coordinates from client area (say mouse click) into original coordinates on the image <0> I'm stunned. Spent X hours browsing docs and googling... still no clue what to do <0> Tried all kinds of .getBoundaries, size, location, X Y height, width... nothing ... <0> Does it have anything to do with the Viewport? <2> L-S: I think so... I did something similar to that, but it's been a long time ago. Let me see if I can dig up the source code. <0> yaay <0> It's kindof confusing... cos the image is in a label, which is in a panel, which is in some layout manager, which is in a frame/dialog, which is relative to the display resolution... you know how it is.... <2> Oh geez <2> The code I have may not be enough to help with that ^^ <0> doesn't matter <0> just hit me with anything you have <0> related to viewports, or whatever does the trick
<2> OK, actually, what I have is a lot more simplistic, I'm not sure this is going to help at all. <2> I was just drawing to a Graphics object contained within a JFrame <0> oh... :( <0> too bad <0> Thanx for digging it up, though! <2> No problem, sorry for the false hope! <0> I'll stay here while I continue bashing google, perhaps some good soul will think of something <0> lol it's ok <2> I haven't done Java UI stuff in ages.. too busy doing web stuff for work! <0> rgr <3> hi <3> pretty basic question <3> what's the difference between <3> public cl*** Foo { } <3> and <3> cl*** Foo { } ? <4> public & package protected. See the Java tutorial. <5> is there any API that lets me craft my own TCP/UDP packets? <6> slt <7> hi <7> does anyone please know how to create an Image or BufferedImage object from a BMP stored in a local file please? toolkit.getImage or .createImage only seems to deal with JPG/PNG/GIF <7> nice nick <8> thanks <9> BMP will no doubt require a separate cl*** to handle and convert, it's an MS image format and Sun probably didn't want to get in too much trouble. That and the fact that it's not overly common these days? <7> mike2: how about tiff? <7> basically anything without compression---I'm only wanting to store binary images <9> tiggger, almost certainly supported somewhere, but you'll notice that JPEG, GIF and PNG are the web's favoured image formats <7> ok thanks mike2 <10> bmp is more or less the raw bitmap data afaik <10> tiggger : btw if you control the local files just convert them jpg <9> or png if the lossy nature of jpg is unacceptable <10> actually you can configure to be loss free afaik <7> I think png might be OK actually <10> but then you lose the compression rate <10> so you'll have rather big jpgs <7> I'm creating "binary images", ie. simply black and white images which act as masks for JPGs. Trouble is, when I save the resulting masks as JPGs, white edges get interpolated <10> if you have full control over the process you should be abe to switch that off <7> there's no pure binary(0,1) type of BufferedImage, I think that's my problem. Perhaps if I change to PNG it might not perform this interpolation <9> yes, if accuracy is important, use a non-lossy format, if it's just 2 bitplane then png or gif are usable interchangeably <9> one bitplane really isn't it <7> I guess a GIF would suffice too. I hadn't thought about it <7> Out of curiosity, what time do most people here (who are active) find it easiest to code? <7> I guess you're all asleep :) Night guys <10> easiest to code : hello world :) <4> At this moment the best time for me is when my PE9 server is running :) <10> lol <11> what would be an efficient way of copying an InputStream to a byte array? I've googled it but can't find a definitive answer <1> read from it, write to a ByteArrayOutputStream <11> and then use the toByteArray() of ByteArrayOutputStream? <1> sure, why not... sounds logical.... try it. <11> when writing to the ByteArrayOutputStream would it be inefficient to do that one byte at a time? <11> cuz i thought about doing it like this: while((x = in.read()) != -1) { out.write(x) } <12> An exception has occurred in the compiler (1.4.2_01). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. <12> java.lang.Cl***FormatError: com/sun/tools/javac/v8/util/Name (Illegal method modifiers: 0x409) at java.lang.Cl***Loader.defineCl***0(Native Method) <12> any idea what this is? <12> i compiled my prog, ran it. Discovered a bug so fixed it and tried to recompile. Cant compile since. Cant compile any file <13> hello java <13> anyone from the philippines?
<14> Hi. In a JTable, How can I know in wich Column was the Click? <14> JTable target = (JTable)e.getSource(); int col = target.getSelectedColumn(); <13> any pinoys here? <15> ... <4> probably a bot, he did the same in another channel. <4> so far its about the only thing I've seen him "contributing" to this place :/ <16> Lion-O, still bn ? <17> hi <17> how can i access straight into hotmail's inbox page? it bounces out to a login page if the user is not logged in. can i just use the normal request with authentication? <4> daYZman: I think you strawled into the wrong channel. <17> Lion-O, i'm seeking for a java implementation <17> trying to accomplish that with java <4> ach so. I guess a mere http authentication should be able to do the trick. <4> You might be able to check from manual logging in what scripts are being used and if you might be able to use a form and POST some data to it, not sure there. In the end a plain login should be possible. <17> hmm okay <17> i'll give that a try.. <18> hello <18> anyone know much about soft versus weak references? <18> i'm just curios, does a weak refernce only get collected when memory is tight or just when the GC runs next? (***uming there are no strong refs here) <18> i read somewhere that soft refs only get collected when memory is tight but what about weak references? <19> Is there anyway to limit my java applications use of resources so that it doesnt tie up 100% of the CPU? <20> icenyne: program properly? use the operating system's functionality? 100% is not a problem - when there is nothing else running, by the way. <20> you DO want your operating system to make full use of the cpu, don't you? <18> weak references anyone? <0> Hey, Java lovers <0> I'm writing some tiny swing appy, and I'm wondering about that invokeLater, the default entryPoint for the program <0> It says it's for thread safety... but is this paranoia, or does it really matter? <20> L-S: it matters. <20> entry point for java applications is the static main method. <21> if I made a seprate java file that was a list of functions I have written and commonly use, is there a way to import them into the global namespace of a java program im writeing? so that i can use then like a native function? <21> *them <20> MyWorldIsHer: stop thinking in c, c++ or whatever it is that has messed up your brain. <20> MyWorldIsHer: BEGINNERSBIBLES Download these two bibles (free of charge): 1) Sun Java Tutorial (http://java.sun.com/docs/books/tutorial/) 2) Bruce Eckel's "Thinking in Java" (http://www.bruceeckel.com/) <20> eckel's book has been said to be a good read for people with c/c++ experience. <4> Best way to make your own toolbox (IMO) is to create package and import whatever you need. <4> create a package ofcourse ;) <20> hi lion <4> Yo Clackwell <22> not a C guru but i highly doubt C is coded that way either :) <22> maybe javascript <20> people get weird ideas in the very short times they spend with languages in university courses, i bet. <22> no doubt <20> they still don't seem to teach communications though...<frown> <22> i doubt there are too many professors that are actually ex programmers heh <21> actually clackwell... aside from ***umeing everyone is a noob, im a java dev for 3+ years... it had just slipped my mind. Once in your life, you could, I dunno, be helpful? Thanks for being useless as usual. <22> haha yeah right <22> apprantly he has spent too much of the last 3 years worshiping his woman <23> s/woman/hand/; <22> :0 <22> i don't understand why beginners just can't admit they are beginners <22> might learn a thing or two <24> hey!! :) <25> Hi, is there a way to kill a thread? I'm using a HTTP connection and sometimes it's dead long... <4> latest JRE's don't recommend on using a brute "stop". Best is to write the thread in such a way that it can detect itself when it should stop. For example; a public cl*** variable can do it. <24> I want to replace certain bytes in a file without affecting the rest of the file, I ***ume I'll use RandomAccessFile, seek to the required position in the file, then how do I replace the next 5 bytes ??? <24> or should I use something other than RandomAccessFile ? <25> Lion-o: yeah I know.. But the method I use to read the URL is out of my control.. I can't check a state while reading <4> netwit: you can basicly run through the whole file sequentially and check for the bytes to change. <4> Lorraine_: well, if you start a thread you can theoreticly stop it. <25> I tested stop, which is deprecated, but it doesn't work anyway.. It just makes the top threads stop waiting to join <24> Lion-O: the position where I want to change the bytes is fixed <24> for instance, lets ***ume I want to replace the bytes from position 0 to 5 with something else <4> Lorraine_: huh ? <26> hax0r. <4> Lorraine_: I can tell you from personal experience that it will stop a thread :P <24> I can seek to the required position, but which method do I use to "replace" the bytes with something else ?? <4> netwit: then I don't really see the problem. <25> Lion-o: Well it still runs, I see the console output... <4> Lorraine_: well, the "stop" routine is deprecated for a reason. It can do its job but still; you're taking an awfull risk regarding stability. <25> yeah... <24> Lion-O: if I do a write() there, then wouldn't it "insert" the data rather than "replace" it <4> Lorraine_: you could also try to suspend or pause it. Or better yet; rewrite the cl*** you're using.
Return to
#java or Go to some related
logs:
md arrays needed for the root filesystem venusruby misskitten techno #AllNiteCafe #apache #AllNiteCafe erwin license #chatzone stakis rouvas witckacy
|
|