それを実行すると、コンソールにこのエラーメッセージが表示されます。どこが間違っているのですか?「C:/Users/Nimit/Desktop/n.txtの表示中にエラーが発生しました」
import java.io.IOException;
import javax.swing.*;
public class exmpleText
{
public static void main(String[] args)
{
String url = "C:/Users/Nimit/Desktop/n.txt";
try
{
JFrame frame=new JFrame("Hi");
JEditorPane Pane = new JEditorPane(url);
Pane.setEditable(false);
frame.add(new JScrollPane(Pane));
}
catch(IOException ioe)
{
System.err.println("Error displaying " + url);
}
}
}