Click here to Skip to main content
15,921,279 members
Home / Discussions / Java
   

Java

 
GeneralRe: How to install java Automatically if not present on Machine?I got some Info.See if guys can Help me out now. Pin
Ravi Sant19-Apr-11 3:55
Ravi Sant19-Apr-11 3:55 
QuestionWriting A file to server Pin
002comp12-Jul-10 19:00
002comp12-Jul-10 19:00 
AnswerRe: Writing A file to server Pin
Gerben Jongerius13-Jul-10 2:04
Gerben Jongerius13-Jul-10 2:04 
GeneralRe: Writing A file to server Pin
002comp13-Jul-10 2:54
002comp13-Jul-10 2:54 
AnswerRe: Writing A file to server Pin
Gerben Jongerius13-Jul-10 3:04
Gerben Jongerius13-Jul-10 3:04 
GeneralRe: Writing A file to server Pin
002comp13-Jul-10 19:47
002comp13-Jul-10 19:47 
QuestionProgressbar while some process is running Pin
002comp8-Jul-10 23:30
002comp8-Jul-10 23:30 
AnswerRe: Progressbar while some process is running Pin
David Skelly9-Jul-10 2:13
David Skelly9-Jul-10 2:13 
The simplest option is simply to start a progress bar running in indeterminate mode (i.e. the bar just bounces back and forwards to show you that something is happening), then load the file, then stop the progress bar when you are finished loading. That way you never need to worry about how big the file is.

The alternative is to get the length of the file before you start (create a File object, and call length()) then track the number of bytes you have read in as a percentage of the total and update the progress bar periodically. Don't update the progress bar too often (e.g. if you have a 2Mb file and you update the progress bar after reading every individual byte, you will be updating the progress bar over 2 million times, which is obviously not a good idea). Make sure you don't load the file on the Swing event handling thread, but make sure that you do update the progress bar on the EDT.

Or, you could use a ProgressMonitor, which is an inbuilt progress dialog that is sometimes useful.

Progress bar tutorial here:

http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/uiswing/components/progress.html[^]
GeneralRe: Progressbar while some process is running Pin
002comp9-Jul-10 2:35
002comp9-Jul-10 2:35 
QuestionFile Object with URL? Pin
002comp5-Jul-10 23:37
002comp5-Jul-10 23:37 
AnswerRe: File Object with URL? Pin
Richard MacCutchan6-Jul-10 1:47
mveRichard MacCutchan6-Jul-10 1:47 
GeneralRe: File Object with URL? Pin
002comp6-Jul-10 19:57
002comp6-Jul-10 19:57 
GeneralRe: File Object with URL? Pin
Richard MacCutchan6-Jul-10 21:19
mveRichard MacCutchan6-Jul-10 21:19 
QuestionSingleton and TCP server Pin
Nadunwow2-Jul-10 7:07
Nadunwow2-Jul-10 7:07 
AnswerRe: Singleton and TCP server Pin
Richard MacCutchan2-Jul-10 8:37
mveRichard MacCutchan2-Jul-10 8:37 
GeneralRe: Singleton and TCP server Pin
Nadunwow2-Jul-10 8:41
Nadunwow2-Jul-10 8:41 
GeneralRe: Singleton and TCP server Pin
Richard MacCutchan2-Jul-10 8:57
mveRichard MacCutchan2-Jul-10 8:57 
GeneralRe: Singleton and TCP server Pin
Nagy Vilmos6-Jul-10 3:53
professionalNagy Vilmos6-Jul-10 3:53 
GeneralRe: Singleton and TCP server Pin
Nagy Vilmos6-Jul-10 3:55
professionalNagy Vilmos6-Jul-10 3:55 
QuestionClass not found issue Pin
False Chicken30-Jun-10 19:54
False Chicken30-Jun-10 19:54 
AnswerRe: Class not found issue Pin
Cedric Moonen30-Jun-10 20:44
Cedric Moonen30-Jun-10 20:44 
GeneralRe: Class not found issue Pin
False Chicken30-Jun-10 20:50
False Chicken30-Jun-10 20:50 
QuestionHow can I use relative path in java to read a file ? Pin
002comp29-Jun-10 2:47
002comp29-Jun-10 2:47 
AnswerRe: How can I use relative path in java to read a file ? Pin
Nagy Vilmos29-Jun-10 11:47
professionalNagy Vilmos29-Jun-10 11:47 
GeneralRe: How can I use relative path in java to read a file ? Pin
002comp29-Jun-10 18:05
002comp29-Jun-10 18:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.