• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GUI - JTable question

 
Piotr Nowicki
Ranch Hand
Posts: 611
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!
 
Roel De Nijs
Sheriff
Posts: 10666
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 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
 
Rob Camick
Ranch Hand
Posts: 2676
9
  • 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: 611
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
Ranch Hand
Posts: 2676
9
  • 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: 611
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: 611
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! :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic