Exception in thread "main" java.lang.IllegalArgumentException: Argument cannot be null
2016-09-05 10:39
816 查看
绘画SWT界面报这样的错误:
原来是加了目录选择框,但是对于路径没有加入为空的判断
</pre><p></p><pre name="code" class="html" style="font-size: 13.3333px;">Exception in thread "main" java.lang.IllegalArgumentException: Argument cannot be null at org.eclipse.swt.SWT.error(SWT.java:4378) at org.eclipse.swt.SWT.error(SWT.java:4312) at org.eclipse.swt.SWT.error(SWT.java:4283) at org.eclipse.swt.widgets.Widget.error(Widget.java:472) at org.eclipse.swt.widgets.Text.setText(Text.java:2241) at com.SearchMain$3.widgetSelected(SearchMain.java:113) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) at com.SearchMain.main(SearchMain.java:131)
原来是加了目录选择框,但是对于路径没有加入为空的判断
sButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog filedlg = new DirectoryDialog(shell, SWT.OPEN | SWT.SAVE); filedlg.setText("请选择jar包路径"); // filedlg.setFilterExtensions(new String[] {}); String path = filedlg.open(); if (path != null) // 不加为空判断会报上面错误 url.setText(path); } });
相关文章推荐
- Exception in thread "main" java.lang.IllegalArgumentException: node to traverse cannot be null!
- Exception in thread "main" java.lang.IllegalArgumentException: input == null!
- Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.spri
- Exception in thread "main" java.lang.IllegalArgumentException: input == null!
- Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljav
- Exception in thread "main" java.lang.IllegalArgumentException
- spark Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Re
- 安装Hive过程中,出现Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxExcepti
- Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violates its gener
- Exception in thread "main" java.lang.IllegalArgumentException
- 关于spring中的一个很诡异的异常:Exception in thread "main" java.lang.IllegalArgumentException
- java 集合排序异常Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violate
- Exception in thread "main" java.lang.illegalArgumentException : illegal component position
- Exception in thread "main" java.lang.IllegalArgumentException: adding a window to a container
- Hive2.1:Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException:
- Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lan
- Exception in thread "main" java.lang.IllegalArgumentException: Some primary key columns are missing
- hException in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://hadoop:9000/tadoop:
- Exception in thread "main" java.lang.ClassCastException: java.math.BigDecimal cannot be cast to ja
- Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: java.net.