954,554 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

jdic browser and right container

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" ));
<blockquote> browserpane = new JScrollPane(webBrowser);</blockquote> // 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());
}

nikolaos
Newbie Poster
10 posts since Nov 2007
Reputation Points: 10
Solved Threads: 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.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You