Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Peter Wolfenstein

Greenhorn
+ Follow
since Oct 23, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Peter Wolfenstein

Hello!

My quest is to add the ability of a thumbnail view for jpg,gif and png images to JFileChooser, just like windows explorer.

So I created a FileView that reads and scales every image file and return it, so that the image is used as a icon for the file.

This works theoretically perfect, however I have huge performance problems. It seems as if all images are being loaded before they are displayed.

So before I can even open a folder, all images are read in and displayed.

Is there a way to solve this problem? I thought about Threads, but I couldn't find a way how to implement useful threading in this case.

Perfect would be a solution, that checks whether the file is being displayed or not and only loads the image when it is displayed.

Does anyone have a solution/idea to this one?
Does anyone know alternative FileChooser for Java which fulfill my requirements? (opensource/free would be nice)

Ty!
14 years ago
Hello!

I have a BufferedImage/Byte Array and i need to create a file object out of it, however I must not write the data to a file and then read it into a file ....

So basically I am trying to convert a BufferedImage which is dynamically generated to a instance of File.

Is there a way to do this?

Thanks guys!
14 years ago
Ty! I solved the problem now

Thanks a lot
Does this mean i have to send the whole HTTP header bytewise?
I tried to send only the image with OutputStream and the rest with BufferedWriter, whoever then the whole fileupload seems to get crippled and the php script does not even recognize that a file upload is requested.


You need to use the stream classes, or work with conn.getOutputStream() directly.



Instead of the for loop i am using the following line of code now.



However this doesn't get it to work as well. I guess i have to write the whole HTTP-Request with the same writer/Stream.

So I need to somehow convert my HTTP-Request to a byte array and send it this way?

TY for you help. Sample Code would be much appreciated
Hello!

I am trying to send a HTTP-Upload Request to a PHP-Script on a Webserver.

Basically what I am doing atm is:
1) Read the jpeg image into a byte array
2) Create a HTTP-Request
3) Send the JPEG bytewise to the Server

Here is my Code of the uploading method:


The jpeg image gets uploaded and stored in a folder by the PHP Script, however I can'T open the image after the upload on the server as I always get the message that it is corrupt....

Do you have any hints what I am doing wrong?

Thank you!
Yes I set my timeout to 50 sec. however one method invocation takes not even a second so something must be wrong then. Can't a set something like a read timeout?!

Jakob
hey!

I need to make a head request to different web pages. some respond relatively slowly (1-2 seconds) and so I don't get any results when trying to read them. I create the connection via sockets as UrlConnection doesn't support HEAD requests and apache commons httpclient library is little bit overhead for this project.

Here is my code:


The host and port variables are set properly. As you can see I have already set the socket timeout to 50 sec. which is very high and no method invocation has ever needed more than 4 secs.

So on most urls I get correct HTTP Headers but on some slower pages I don't get any results. How can I tell my code to wait for a few secs. until the response comes?

Thanks!!

Jakob
Hey!

I was wondering whether there is a counterpart to ObjectOutputStream#writeChars (String str) in ObjectInputStream? Something like ObjectInputStream#readChars (), however I couldn't find such a method in this class.

So my question is, how can I read a serialized String written with writeChars from ObjectInputStream?

Thanks!

Cheers,
Jay
14 years ago
Do you have some code snippet, as I am new to Java.
Thanks!

EDIT:
I tried it out JFrame#setUndecorated (true); works fine

Best Regards,
Jay

[ November 19, 2006: Message edited by: Jakob Buchgraber ]
[ November 19, 2006: Message edited by: Jakob Buchgraber ]
15 years ago
Hello!

I'd like to know how to display an image or some component without any borders?

This technique is used by Netbeans, OO.org, Zend Studio, Mozilla Browser etc. on start up.

Thanks!

Jay
15 years ago
I am using Inspiron 9400 and I really like it. A friend of mine owns a 6400 which is also pretty nice and doesn't get as hot as a MacBook Pro for example. The only thing I have to criticize on [96]400 is the display. It really reflects every object in the background, but that shouldn't be a problem if you are working inside.
15 years ago