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());
    }

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.