关于我的问题 (可能是),我发现了另一个无法从SwingWorker线程捕获和打印的异常类型。
如何生成RepaintManager异常?
我读过CheckThreadViolationRepaintManager和这种方法的Alexander Potochkin,但似乎没有什么能解决我的问题。
发布于 2011-10-16 23:14:35
创建自己的异常
class RepaintManagerException extends Exception
{
String msg;
RepaintManagerException()
{
msg = new String("type message here");
}
}用法
public class My_Exception
{
public static void main (String args [ ])
{
try
{
// your code
if (expression) throw new RepaintManagerException( );
}
catch (RepaintManagerException e)
{
System.out.println (e);
}
}
}https://stackoverflow.com/questions/7787998
复制相似问题