• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to Create directory select box

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i want to create a application for selecting directory on my web page.
like file type in html which allows us to select only file.
please help me out if any one knows anything about it.
thanks ,
indu
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'like file type in html' - are you talking of javascript?
I know FileDialog in java.awt or JFileChooser in javax.swing.
I would recommend a JFileChooser, and define an own FileFilter, which doesn't return true, by matching a FileExtension, but true by 'File.isDirectory ()'.
I think I have recently seen, that there is a new introduced FileFilter in newer versions of the jdk, but I'm not sure.
 
Indrayani Bhoir
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have created a Java application to select a directory using Java class "JFileChooser". but i am facing few problem like:
It allows us to do so but only through the mouse.On pressing "Enter" on the directory it does not display it's sub directories. Also on pressing tab it does not automatically highlight a directory. Only on pressing UP & DOWN Arrow keys the focus is visible. Kindly provide a suitable solution to this or if there is any other component in Java which enables us to select a directory through the mouse and the keyboard then please give details for the same.
regards,
indu
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic