blob: e0e8b790c87828ad1e66298e3494183b4e5911f7 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>
Using Surround with Try/Catch
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
</head>
<body>
<h1>
Using Surround with Try/Catch
</h1>
To surround a statement or a set of statements with a try/catch block:
<ul>
<li>
In the Java editor, select the statement or a set of statements that you want to surround with a try/catch block.
</li>
<li>
Do one of the following:
<ul>
<li>
From the menu bar, select <strong>Source &gt; Surround with try/catch Block</strong> or
</li>
<li>
From the editors pop-up menu, select <strong>Source &gt; Surround with try/catch Block</strong>
</li>
</ul>
</li>
<li>
'catch' blocks for all uncaught exceptions (if there are any) are created. If there are no uncaught exceptions, a dialog appears informing you about this fact and
asking if you want to create a 'catch' block for java.lang.RuntimeException.
</li>
</ul>
<p>
<img src="../images/ngrelc.gif" alt="Related concepts" border="0" height="27" width="159"><br>
<a href="../concepts/concepts-7.htm">Java editor</a>
</p>
<p>
<img src="../images/ngrelt.gif" alt="Related tasks" border="0" height="27" width="159"><br>
<a href="tasks-54.htm">Using the Java editor</a><br>
<a href="tasks-176.htm">Using Structured Selection</a>
</p>
<p>
<img src="../images/ngrelr.gif" alt="Related reference" border="0" height="27" width="159"><br>
<a href="../reference/ref-menu-source.htm">Source menu</a>
</p>
<p>
<a href="../hglegal2003.htm"><img src="../images/ngibmcpy2003.gif" alt="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved." border="0" height="14" width="324"></a>
</p>
</body>
</html>