我有以下布局.
当我在MainActivity类中创建WebView
和GestureOverlayView
对象时,它会返回null
两个对象.
GestureOverlayView gesturesView = (GestureOverlayView) findViewById(R.id.gestures);
WebView webView = (WebView) findViewById(R.id.webview);
Run Code Online (Sandbox Code Playgroud)
我的布局:
<?xml version="1.0" encoding="utf-8"?>
<android.gesture.GestureOverlayView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gestures"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
</android.gesture.GestureOverlayView>
Run Code Online (Sandbox Code Playgroud)
当我将上面的布局更改为以下(我移动android.gesture.GestureOverlayView
到里面LinearLayout
),它工作正常.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.gesture.GestureOverlayView
android:id="@+id/gestures"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</android.gesture.GestureOverlayView>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚我以前的布局有什么问题.
请有人解释一下.
我有一个主应用程序框架(MainFrame class
).在a的actionperformed事件中JButton
,a JPanel (MyJPanel class)
通过放入来打开JDialog
.我没有扩展JDialog
到创建MyJPanel
类,因为我也可能在其他目的上需要MyJPanel.
我的问题是我无法以编程方式关闭MyJPanel
显示的内容JDialog
.有什么我想念的吗?你能搞清楚吗?
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
public class MainFrame extends JPanel {
public MainFrame() {
JButton btnOpenJdialog = new JButton("Open JDialog");
add(btnOpenJdialog);
btnOpenJdialog.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JDialog jd = new JDialog();
MyJPanel mjp = new MyJPanel(true);//showing in JDialog
jd.setTitle("JDialog");
jd.add(mjp);
jd.pack();
jd.setVisible(true);
}
});
} …
Run Code Online (Sandbox Code Playgroud) 我正在尝试从Web上挖掘一些文本的应用程序,但我不确定执行文本挖掘的最佳方法是什么.
我对这个问题的要求是了解什么是最常用的技术/算法来执行文本挖掘并在文档中进行一些信息检索(而不是用于索引).