Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

GUI - JTable question

 
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Ranchers,

Did you specify explicitly the width of the columns of the JTable or did you use the equal width for each column?

I've noticed that if I set the column widths and hit 'search' button (which calls controler and sets new model for the view) it resets the column widths... One possible way is to execute my own 'setColumnWidths' method after each search button click event but I don't really like this idea.

Also, if user changes the column widths as he likes and hits 'search' button it will return to uniformly distributed columns (without executing setColumnWidths) or revert to my own columns width (when executing setColumnWidths). I don't like any of those as it seems to ignore what the user defined...

Help needed Ranchers!

Cheers!
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't do anything about the width of the columns, keeping it simple as usual
 
Rancher
Posts: 3205
29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you post a Swing question in this forum?
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy!

Thanks Roel - won't bother about it then :-)

@Rob Camick

Because the question is strictly related to the SCJD assignment and it is more about:
- user (Assesor) experience,
- how other Users did implement their solution,
- did they have the same problem,
- did they bother about it.

rather than:
- how to do it.

Thanks for the concern :-)
 
Rob Camick
Rancher
Posts: 3205
29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The people who actually use Swing and know the answer to the question read the Swing forum. There is a simple explanation and solution to the problem.
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did post this question on the Swing forum here.
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So it really is simple - just look at the linked thread! :-)
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic