Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-09-2010, 09:05 AM
Member
 
Join Date: Oct 2009
Posts: 55
Rep Power: 0
anilkumar_vist is an unknown quantity at this point
Default JTable image
Hi am able to generate an image of jtable but i want it with header
Code:
  // TODO add your handling code here:
        try
        {
       BufferedImage buffy = new BufferedImage(this.jTable1.getWidth(),this.jTable1.getHeight(),java.awt.image.BufferedImage.TYPE_INT_RGB);
       Graphics g = buffy.getGraphics();
      
     this.jTable1.paint(g);
       String path=System.getProperty("user.dir");
       path+="\\1.png";
       OutputStream out=new FileOutputStream(path);
       JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
       JPEGEncodeParam param =encoder.getDefaultJPEGEncodeParam(buffy);
       encoder.getDefaultJPEGEncodeParam(buffy);
     param.setQuality(1.0f, false);
    encoder.setJPEGEncodeParam(param);
     encoder.encode(buffy);
        }catch(Exception e)
        {
            e.printStackTrace();
        }
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding New JTable in JTable anilkumar_vist New To Java 0 01-27-2010 09:27 AM
Problems drawing a section of an image onto another image. Cain Java 2D 1 04-17-2009 01:44 AM
[SOLVED] manipulating the pixel values of an image and constructinf a new image from sruthi_2009 AWT / Swing 14 04-10-2009 09:46 AM
Jtable duplicates through Hashtable (JTable condition problem) my assignment plz help salmanpirzada1 Advanced Java 2 05-15-2008 11:15 AM
Converting multiple banded image into single banded image... Image enhancement archanajathan Advanced Java 0 01-08-2008 06:29 PM


All times are GMT +2. The time now is 11:18 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org