• 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

JTable in a JTabbed panel

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written a CheckBook application using a JTable contained in a JFrame. Now, I would like to embed it in a tabbed panel. I cannot do this directly as a JFrame is a window, and the JTabbed component can only use a panel component (JPanel). First, can a JTable be embedded in a JPanel component? Second, can anyone direct me to some sample code to embed a JTable in a JTabbed panel?
Thanks in advance
jlbalder
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
don't think too complicated
[CODE]
JScrollPane scrollPane = new JScrollPane(myTable);
JTabbedPane tabPane = new JTabbedPane();
tabPane.add(scrollPane);
JFrame f = new JFrame();
f.getContentPane().add(tabPane, BorderLayout.CENTER);
[\CODE]
cheers
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"jlbalder" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

Thanks! and welcome to the JavaRanch!
 
reply
    Bookmark Topic Watch Topic
  • New Topic