JavaFAQ Home » Java Newsletters
[ The Java FAQ Daily Tips, weekly publication ]
8 May 2003|
Foreword: Excuse me for
possible mistakes. English is not native language for me.
In this issue:
Hello dear friends!
Question: I want to use progress bar for downloading
files from Internet. But how do I know in advance the file size and then show
the progress of downloading?
Answer: First, try to get file size
int filesize =
if it returns -1 then you really
do not know the file size.
Second step in this case will
be to use progress bar in indeterminate mode - Mozilla like. This is available
since Java 1.4. In this mode, the progress bar displays animation to indicate
that work is occurring. As soon as the program determines the length of the
task, you should switch the progress bar back into its default, determinate
Question: Are classes implementing Externalizable
considered Serializable classes?
Answer: Yes, since public interface Externalizable
extends Serializable (according to API)
Latest posts on our
|Setting out java gui code
Hi. I'm kinda relatively new to
creating gui's and i kinda get some of the concepts in swing. However, I'm
slowly finding that I'm coding everything in one class which is pretty bad since
i'm writing a relatively thick gui client.
Are there any patterns or
anything of the sort for laying out swing code?
|Help W/ Binary File Downloading from http server!
I am attempting to
write a program which will download multiple zip files from specified websites.
I am having problems though, when the http server requires a domain, name and
password. The password also has unusual characters in it, such as #, and /. The
program currently creates a listing of all the files to be downloaded and puts
them into an array, but I would really like it to go one step further, and
actually have it download them, which I haven't gotten to work yet. I would
greatly appreciate any info on how to download binary files through http
connections requiring windows style logons.
|blinking minimised window
I wanted to implement blinking
minimised window when any new message comes to me like the ones in the
I am working in linux
|sockets ,force close and garbage collection
I have developed a server
application that can accept one connection at a time. One of the server options
is that the client can request to chat with the server.If this is the case, the
the server opens a chat window which uses another class 'chatserver' in order to
wait for and accept connection. However, i found out that if the user on the
server closes the ChatGui of the server (maybe because they finished chatting)
and they reopen it after about 4 minutes a bind exception will be thrown. After
testing i found out that the Gui is disposed but the serversocket still waits
and accepts connections while another gui opens and tries to bind the same port.
i have a cleanup method that closes I/O streams and closes the serversocket and
socket objects as well.
Does anyone have anyidea how to force the server
socket release the specific port?
Thank you in advance.
|when i compile i get a grey screen?!?!?
When I compile my program and
run it I get a grey screen? It compiles okay with no errors. Any know where i
could be going wrong?
I have a password box that will
be linked to a database. Once the users enter their password they will have
another panel where they can register their hobbies. It is not for the net but
simply on JBuilder for the moment. I had no problem setting up the GUI for both
the password and the other panel (the database link will be for later!) but as
I'm a very novice programmer I don't know how to link the two so that on a
user's screen there is a smooth transition between the password and the hobby
panel. The password class looks like this:
|JPopupMenu removing borders / insets
I have a popup menu
but, though I remove the borders, there is still space at the top and bottom of
the JPopupMenu. There is also a white line at the left side and a grey line (or
component?) on the right of the JPopupMenu. How can I remove this space / lines
from a JPopupMenu? Is this something that can be done through methods of the
Swing components or is it necessary to use L&F API to remove these insets
ask your questions and help each other at our Java Forum:
The Java FAQ Daily Tips is a newsletter
that is only sent to those who have specifically subscribed
to it (double opt-in).
To subscribe/unsubscribe to "The Java FAQ
Daily Tips" weekly edition newsletter visit our page
If you have troubles please contact us: firstname.lastname@example.org
If you have added a link to http://javafaq.nu on your WEB-site, please let us
know and you will get listed on our
"pages linking to us" pages! If your
page is a programming is programming relates you will of
course get listed in the WEB-directory as well. Also, if you link to us, you
have a chance to be listed in this
newsletter as well.
More information and graphics artworks can
be found here
For information on advertising on the Java
FAQ's Daily Tips Newsletter, send an email to: email@example.com
You will get the answer
immediately from auto responder!
Send your comments, questions, praise and
complaints to us: firstname.lastname@example.org
Copyright (c) 2000 -
2003 John Andersson, All rights reserved.
Printer Friendly Page
Send to a Friend
Search here again if you need more info!