Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

pubzzle of db-file-path expression?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone:
When the program run in local mode,it allow user to input the db-file-path and db-file-name.if the db file located E:\javacode\db.db,the db-file-path is E:\javacode\ or E:\javacode in JTextField?
I think E:\javacode\ is better,db-file-path add db-file-name is ok.But E:\javacode is familiar with user ,and if on Win32,db-file-path + "\" + db-file-name is ok,if on Solaris,db-file-path + "/" + db-file-name is ok,it's difficult to judgement.
Thanks for your answer.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JFileChooser
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are other classes in the swing package that you could use for the input of the db-file-path, instead of using JTextField.

And the normal slash '/' is the default directory separator. For example, the path "dir1/dir2/file.db" is compatible with Windows.
 
he qinfeng
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
JFileChooser is the better way,and I will use it to work out.
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi He,

Just for reference, you can always access the system dependant seperator from the static File.separator variable.

Regards,

Jon
 
he qinfeng
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Entwistle.
By your opinion,I also solved my problem.
 
Hey! Wanna see my flashlight? It looks like this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!