Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

printing jtable  RSS feed

 
Jacques Chaurette
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all and thanks in advance.

I am trying to print a jTable, it seems there is a simple command
JTable.print(), if my table is called jTable1 then
jTable1.print(); should do it.

compiler does not agree and says cannot resolve symbol method. I have import
javax.swing.table.*; which should be sufficient to provide this method. No
doubt there is something terribly complicated that I am missing.

Cheers,

Jacques
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a 1.5 method. What version are you using? If you are
compiling on the command line, you can type:

$javac -J-version

$java -version
 
Jacques Chaurette
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah Ha I see, I am using SDK 1.4 for my applets. Is there a print method for 1.4?

Jacques
 
H Lander
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ability to print tables was introduced in Java 1.5. There is nothing corresponding to it in Java 1.4. However, I am sure that if you search the web you can find some code that will print your table under Java 1.4.

I've worked with a comercial package that prints tables under both Java 1.4 and 1.5, although it does not work in applets (only applications). Its called the "Java Print Dialog Framework".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!