As you forgot to shed some light into file selection process, I can only recommend you to have look and consider use of File method getAbsolutePath() that will return String representation of file location
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Where are you getting these methods from? Neither I, nor the API documentation, knows anything about them.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Off topic - I guess somebody nailed your a$$ masijade :D , or somebody uses same name on Sun forum (highly unlikely)
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Off topic - I guess somebody nailed your a$$ masijade :D , or somebody uses same name on Sun forum (highly unlikely)
No. It's my nick, and DeskTop, and getDeskTop are valid, it's "Copy" and "Move" that don't exist. ;)
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Without mentioning any classes, describe exactly what it is you want to do again, because the first post, to me, doesn't make much sense.
Where is the "file" coming from?
Why do you need to "copy" it?
And, if you are copying it, why don't you know where you are copying it?
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Aren't "adding the books" to the database and "storing the books to the database" the same exact thing? You said them as if they were different. And we don't do chats and stuff like that, keep it on the site.
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
I still don't understand exactly what you want.
If this is a web application, then the "File" and "DeskTop" classes don't come into play (if you mean an application used through a browser), and so I don't know what you're getting at.
If it is not a web application, but rather a "distributed" application, then you would insert books using the same connection as you do to query them. In this case, see Sun's JDBC Tutorial.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
If it is a "distributed" app, I assume you have a GUI. Look at the JFileChooser class.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
APPROVE_SELECTION is a constant, which cannot do anything on its own. It is simply a variable that has a value. approveSelection() is a method, and methods can "do things". For example APPROVE_SELECTION might be a value indicating whether or not to OK what the user has selected. But the method approveSelection() will go ahead and do something to approve the selection. In other words variables (APPROVE_SELECTION) store values, methods (approveSelection()) do things. I hope that makes sense.
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354