# JAVA: Custom fuctions for JTable

**URL:** <https://forum.kirupa.com/t/java-custom-fuctions-for-jtable/274973>\
**Category:** programming\
**Created:** [November 7, 2008, 5:29am UTC](https://forum.kirupa.com/t/java-custom-fuctions-for-jtable/274973 "2008-11-07T05:29:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikomax](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nikomax/32/3664_2.png) [@nikomax](https://forum.kirupa.com/u/nikomax)\
**Post date:** [November 7, 2008, 5:29am UTC](https://forum.kirupa.com/t/java-custom-fuctions-for-jtable/274973/1 "2008-11-07T05:29:14Z")

</div>

Hello there!  
Seeing as I have to learn Java for my computer science course, I decided to get ahead as a whole lecture on if()else() functions with the title “Advanced programming” seemed a bit too easy for my liking. After all I too out a student loan to learn =/ _Sorry I will stop moaning now!!_  
Anyway I am learning Swing for a program I have made, a simple library program in fact, And i want the data to be presented in a table. Now i have just figured how to use a custom table model with the AbstractTableModel and wanted to know how versitile it is.

What I want to do is to include a function somewhere that will resize all of the coloums of the JTable. I have a 90% idea on how to write this function but i dont know where to put it.  
Ideally i would like to put it in the table model, but then it becomes how do i run the method through my table object .

If you have any ideas or suggestions on what I could do it would be a great help!!

Thanks
