• Post Reply Bookmark Topic Watch Topic
  • New Topic

The problem still persists  RSS feed

 
Sandhya Rprasad
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
My GUI comprises of the following :
JAPplet => Bean =>( JScrollPane => JTable and some buttons)
I'm loading the table with some data . It has 4 columns and n rows with the rows increasing by the data loaded. I've made the last 2 columns hidden. Now, when I'm trying to add the data, my JTable is growing in size without the scrollpane appearing . This is covering up the buttons inside the bean since the JTable's size is >sing. Could somebody suggest me with a solution.I'd really appreciate a faster response.Is this problem due to the hiding of columns ?!! Should I remove those 2 columns?!!
Thanks
sandhya

 
David Freels
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try adding the JTable to an JPanel and then add the JPanel to your JScrollPane.
David
 
Sandhya Rprasad
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David Freels:
Try adding the JTable to an JPanel and then add the JPanel to your JScrollPane.
David

Thanks David
I tried your soln, but it did'nt work for me.I solved the problem, basically, I was trying to instantiate the Scrollbar policy twice which was turning into a weird screen. All I had to do was to remove that line which I'd forced in the init() method. Thanks again.
Sandhya
 
Giren Desai
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I would like to know how you have hidden the columns of Table in a bean...
Just let me know ASAP.
regards,
Giren Desai
Originally posted by Sandhya Rprasad:
Hi
My GUI comprises of the following :
JAPplet => Bean =>( JScrollPane => JTable and some buttons)
I'm loading the table with some data . It has 4 columns and n rows with the rows increasing by the data loaded. I've made the last 2 columns hidden. Now, when I'm trying to add the data, my JTable is growing in size without the scrollpane appearing . This is covering up the buttons inside the bean since the JTable's size is >sing. Could somebody suggest me with a solution.I'd really appreciate a faster response.Is this problem due to the hiding of columns ?!! Should I remove those 2 columns?!!
Thanks
sandhya

 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Giren
I used this piece of code to hide the columns. Hope this works :
TableColumn column1 = null;
column = JTable1.getColumnModel().getColumn(the column no. u want to hide, for eg; 1st column = 0);
column.setMaxWidth(0);
column.setMinWidth(0);
column.setWidth(0);
column.setResizable(false);
column1.setPreferredWidth(0);
Meghna
 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just corrected the previous mailed code
TableColumn column = null;
column = JTable1.getColumnModel().getColumn(the column no. u want to hide, for eg; 1st column = 0);
column.setMaxWidth(0);
column.setMinWidth(0);
column.setWidth(0);
column.setResizable(false);
column.setPreferredWidth(0);
Meghna
Meghna[/B]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!