Question: I have a simple tab system but I'm a bit stuck on exactly how to make this work.

I'm using ng-repeat to spit out the tabs and the content and so far this is working fine.

Here are my tabs:

```
<ul class="job-title-list">
     <li ng-repeat="tab in tabBlocks">
        <a href="javascript:;" ng-click="activeTab($index)">dummy content</a>
     </li>
</ul>

```

And here's the repeated content which needs to match up to the tabs:

```
<div ng-repeat="content in contentBlocks">
    <p>more dummy content</p>
</div>

```

And finally, my function (the console log returns the correct indexes from the tabs)

```
$scope.activeTab = function(i) {

   $scope.selectedTab = i
   console.log($scope.selectedTab)

}

```

Any suggestions on how I should go about this? I've looked into ng-show, ng-switch and ng-if to show and hide the appropriate content but I've been stuck on this for a while...

Many thanks!

Answer: 
```
jFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

```

Now for a bit of explanation. The closest equivalent to as seen in the question is..

```
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

```

But that kills the entire JRE irrespective of other non-daemon threads that are running. If they are running, they should be shut down or cleaned up explicitly.

If there are no other non-daemon threads running, `DISPOSE_ON_CLOSE` will dispose the current `JFrame` and end the virtual machine.
If you're talking about a `JButton` that you want to put into your form, then you want to invoke `JFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)` in your constructor for the form, and then your button handler can invoke

```
dispose()

```

to close the form.