登录和注册类中的运行时异常

vaj7vani  于 2021-07-12  发布在  Java
关注(0)|答案(1)|浏览(343)

如何处理线程中的异常?
代码;

private static void main(String[] args) {
  Login_WE h = new Login_WE();
  initComponents();
  h.setDefaul
  ...
  psv.initComponents(){
   throw new Unsupported Operation Exception (“Not supported yet.”);
  }

输出;
线程“main”java.lang.unsupportedoperationexception中出现异常:尚不支持。在customside.tab.customsidetab.initcomponents(customsidetab。java:30)在customside.tab.customsidetab.main(customsidetab。java:22)c:\users\kachconrad\appdata\local\netbeans\cache\8.2\executionsnippets\run。xml:53:javareturned:1生成失败(总计time:2 seconds)

cs7cruho

cs7cruho1#

你可以这样做

try {
    initComponents();
} catch(UnsupportedOperationException e) {
    //Log error here
}

相关问题