blob: c72d86e424d9a00debf44100b9bbb0e972694af2 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<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.png" alt="Related concepts" border="0" ><br>
<a href="../concepts/concepts-7.htm">Java editor</a>
</p>
<p>
<img src="../images/ngrelt.png" alt="Related tasks" border="0" ><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.png" alt="Related reference" border="0" ><br>
<a href="../reference/ref-menu-source.htm">Source menu</a>
</p>
</body>
</html>