小编Use*_*234的帖子

我的计划有什么问题?我知道我犯了一个错误.但是哪里?

运行时,我在控制台中收到此错误消息.我哪里出错了?"显示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);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

java swing

-2
推荐指数
1
解决办法
141
查看次数

标签 统计

java ×1

swing ×1