First of all, I'm not a Java programmer and I'm just modifying existing code to suit my needs so please bear with me because of my very limited knowledge in Java.

This is a part of my code:

```
public String getIp() throws Exception {
    URL whatismyip = new URL("http://checkip.amazonaws.com");
    BufferedReader in = null;
    try {
        in = new BufferedReader(new InputStreamReader(
                whatismyip.openStream()));
        String ip = in.readLine();
        return ip;
    } finally {
        if (in != null) {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

```

Now when I try to call `getIp()`, I'm having a compilation failure: `unreported exception java.lang.Exception; must be caught or declared to be thrown`.

Here's part of the code that calls the `getIp()`:

```
Phrase downloadDate = new Phrase();
downloadDate.add(new Chunk("On: " + new SimpleDateFormat("MMMM d, yyyy").format(new Date()), FONT_DATE));
downloadDate.add(new Chunk(" at " + new SimpleDateFormat("h:mm a z").format(new Date()), FONT_DATE));
Phrase downloader = new Phrase("This article was downloaded by: " + getEperson(), FONT_DATE);
String IP = getIp();
Phrase userIP = new Phrase("IP Address: " + IP, FONT_DATE);
Phrase userDownloadDate = new Phrase(downloadDate);
Paragraph downloadDetails = new Paragraph();
downloadDetails.add(downloader);
downloadDetails.add(downloadDate);
downloadDetails.add(userIP);

```

This may be a trivial question to ask, but I'm wondering why I'm having the error "must be caught or declared to be thrown" when it is already declared in the `public String getIp()`?
['https://Stackoverflow.com/questions/28654728', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1919069/']
From the `NSBox` [documentation](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBox_Class/#//apple_ref/occ/instm/NSBox/setFillColor:):

> 
> **Special Considerations**
> 
> 
> Functional only when the receiver’s box type (`boxType`) is `NSBoxCustom` and its border type (`borderType`) is `NSLineBorder`.
> 
> 
>
set **Box Type** to **Custom** , as in the attachment:

[![enter image description here](https://i.stack.imgur.com/ASB1c.png)](https://i.stack.imgur.com/ASB1c.png)