GWT Java - 如何在面板或小部件中显示另一个外部网页?
GWT Java - how to display another external web page within a panel or widget?
我需要一个面板或小部件,我在其中设置了一个 URL 并且 panel/widget 在其中显示了 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);
我需要一个面板或小部件,我在其中设置了一个 URL 并且 panel/widget 在其中显示了 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);