java - GWT Java - 如何在面板或小部件中显示另一个外部网页?
问题描述
我需要一个面板或小部件来设置 URL,并且该面板/小部件在其中显示 URL 的网页。类似于 WebView 和 UIWebView 在 Android 和 iOS 应用程序中的工作方式。
解决方案
一种解决方案是使用带有 iFrame 的 HTMLPanel
HTMLPanel htmlPanel = new HTMLPanel("<iframe src=\"https://www.youtube.com/embed/dQw4w9WgXcQ\" style=\"width:600px; height:600px;\" >Unfortunately this content could not be displayed</iframe>");
RootPanel.get("mainDiv").add(htmlPanel);
推荐阅读
- java - java - 传递 Vectors 参数数组的类型,以用作类
类型参数 - javascript - 如何居中加载动画并使页面的其余部分像灯箱效果?
- angular - 这在 ngModel
- java - why i can make few file object in for loop at java
- clang-format - clang-format 似乎忽略了 CommentPragmas
- vba - Application.ontime follow the wrong speed
- visual-studio - 在正在运行的 Visual Studio 实例中打开文件
- google-photos - Google Photos API - 为什么有些查询是 POST 而有些是 GET?
- css - Wordpress - Image containers too large
- go - 如何使用带有用户令牌 E2E 的 CF 客户端