Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / April 2006

Tip: Looking for answers? Try searching our database.

Problem with JTable cell renderer

Thread view: 
Chanchal - 20 Apr 2006 10:03 GMT
HI All,

In my Swing application i'm using a few cell renderers for JTable. I'm
using an image with rounded corners, shadows and all to give the cell a
very good look. But if the cell is not exactly same dimension as that
of the image, the image is getting truncated. Is there any way to make
the image shrink and grow a required by the size of the cell. Please
advice

Thanks in advance

Chanchal
Liz - 27 Apr 2006 22:26 GMT
You need to create your own cellrenderer to do this.

Get the dimension of the cell using the method

Rectangle getCellRect(int row,
                            int column,
                            boolean includeSpacing)

Then scale the image to the size of the cell, then update the
cellrenderer with this scaled image

-------------------------------
QuickTable - A free javabean grid control using Jtable which hides all
the complexities of JTable
http://quicktable.org


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.