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: 
If you want to create a button which exits the application when the user clicks it, try this:

```
JButton exit = new JButton("exit");

ActionListener al = new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
        System.exit(0);
    }
};

exit.addActionListener(al);

```

Now when you press on that button the application will exit.
Very simple answer is as @Andrew Thompson said.

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

```

**OR**

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

```

and if u want to make it in other way by code. then u can put this code anywhere. in events.

System.exit(0);

hope this will help.