java - 如何使用 Java Swing 绘制完整的网页?
问题描述
我试图在 Java Swing 中绘制一个完整的网页,但它看起来很糟糕。它需要在 Chrome 或其他浏览器中看起来像什么?
它看起来像这样:
不像 youtube 上的普通视频。
资源:
JEditorPane jep = new JEditorPane();
jep.setEditable(false);
try {
jep.setPage("https://www.youtube.com/watch?v=EcdbEax46bA");
}catch (IOException e) {
jep.setContentType("text/html");
jep.setText("<html>Could not load</html>");
}
JScrollPane scrollPane = new JScrollPane(jep);
JFrame f = new JFrame("Test HTML");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(scrollPane);
f.setPreferredSize(new Dimension(800,600));
f.setVisible(true);
那么我需要什么才能查看完整的网页?
解决方案
推荐阅读
- firebase - 如何解决我的swift4项目中的firebase转换问题..(NSDictionary to Swift Object)
- amazon-web-services - Amazon Cognito 用户锁定
- python - python读取csv并休息
- python - CNN 层可视化
- c++ - Stoi 以 std::invalid_argument 类型的未捕获异常终止:stoi:无转换
- android - Firebase fcm 令牌未生成
- java - 如何使由wsdl生成的java类Serializable
- github - 在不克隆的情况下更新 GitHub 存储库
- javascript - Angular 仅在自上次轮询后发生更改时才更新对象
- excel - 如果添加了行,则自动在另一个工作表中插入行