0

i am trying to make an autorun cd with a digital book in java.
1) How can i find out the cd or dvd drive letter in which has entered my cd?
in the code section below i use this very ugly way to achieve this.
2)which is the best container that i can use with org.jdesktop.jdic.browser?

final Container pane = getContentPane();
driveletter = JOptionPane.showInputDialog(null , "ENTER THE DRIVE LETTER (ENGLISH) OF THE CD OR DVD YOU ARE USING ");
    driveletter = driveletter.toUpperCase();
    try {
      webBrowser = new WebBrowser(new URL("file:///" + driveletter + ":\\introduction.htm" ));
      browserpane = new JScrollPane(webBrowser);     // browserpane.createHorizontalScrollBar();
    //  browserpane.createVerticalScrollBar();
      browserpane.setBounds(new Rectangle(200,80,610,460)); //(x,y,width,height)      
      pane.add(browserpane);     
      setVisible(true);
    }
    catch (MalformedURLException e) {
      System.out.println("first use of browser before any chapter sellection " + e.getMessage());
    }

Edited by mike_2000_17: Fixed formatting

2
Contributors
1
Reply
3
Views
9 Years
Discussion Span
Last Post by Ezzaral
0

You could just iterate the available roots from File.listRoots() and check exists() to find it for them, since you know the file name you are looking for.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.