• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

regarding JTable scrollabrs

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a small doubt in JTable,i want to display 10 number of rows, each row contains data(i can retrieve data from web services and displayed in Table cell)in that time i don't need scrollbars for that particular table, because of i am trying to print that table vertical scrollbars are coming in the printed page and aslo inside the vertical scrollbars the data is not showed in printed page..is there any possibility to fix perfect size without using scrollbars for that talbe.thank you in advance.
 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by tadi raja:
i have a small doubt in JTable,i want to display 10 number of rows, each row contains data(i can retrieve data from web services and displayed in Table cell)in that time i don't need scrollbars for that particular table, because of i am trying to print that table vertical scrollbars are coming in the printed page and aslo inside the vertical scrollbars the data is not showed in printed page..is there any possibility to fix perfect size without using scrollbars for that talbe.thank you in advance.



I'm not sure exactly what you are asking (for example: Do you know the pixel size you want and are asking how to set it, or are you asking how to figure out how many pixels you need?) but I feel I should point out that it's always safe to put the JTable in a JScrollPane. If it fits, then the scroll bars won't even appear* and the user will be none the wiser. Also, the table's header won't automatically appear if you don't use a JScrollPane.

*This is actually up to the look and feel, I believe, but most LnFs behave this way.

[edit: footnote added]
[ December 09, 2008: Message edited by: Brian Cole ]
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Brian Cole ,
i am using JScrollPane to fit the JTable,still i got vertical scrollbar.can you please help me.
 
Brian Cole
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by tadi raja:
i am using JScrollPane to fit the JTable,still i got vertical scrollbar.can you please help me.



Which look and feel are you using?

I get no scroll bars with this code under Windows LnF or Metal.



If I reduce the size of the frame to be smaller than the height of the six rows, then a vertical scroll bar appears. How many rows does your table have?
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my table have max of 10 rows ...
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make the scrollbar policy as needed instead of showing always.
 
reply
    Bookmark Topic Watch Topic
  • New Topic