• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

JTable

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help.
I would like to get a table with columnHeads, rows and scrollbars.
The following code does not show scrollbars.
table = new JTable( rows, columnHeads );
JScrollPane scrollpane = new JScrollPane( table );
getContentPane().add( scrollpane, BorderLayout.CENTER );
The following code does show scrollbars but does not show "columnHeads".
table = new JTable( rows, columnHeads );
JPanel panelTable = new JPanel();
panelTable.add(table);
JScrollPane scrollpane = new JScrollPane( panelTable );
getContentPane().add( scrollpane, BorderLayout.CENTER );
What am I doing wrong?
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic