TableCellRenderer for a JTableCell contains imageIcon

Hi, all.
I am writing a TableCellRenderer for a column in JTable which contains imageIcon. It sets the background of the cell to a specific color. It worked fine when the column's datatype is string. But when the datatype of the cell is an imageIcon, the setBackground method somehow overlaps the imageIcon, basically, I can't see the image Icon anymore. As I understand, while the datatype is imageIcon, the JTable basically Centers the imageIcon on a JLabel, then when I set the background of JLabel to a color, it should work, right? Here is the code, any help would be greately appreciated.
<pre>
package org.anser.newshound.gui;
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
import java.util.*;
import java.io.*;
public class TableCellRendererForThumbnailTable extends DefaultTableCellRenderer
public static final Color DELETE_COLOR = Color.red;
public static final Color NULL_COLOR = Color.white;
private int[] rowStatus;
public TableCellRendererForThumbnailTable(int[] rowStatus){
super();
this.rowStatus = rowStatus;
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column){
JLabel c = (JLabel) super.getTableCellRendererComponent(table,
value,
isSelected,
hasFocus,
row,
column);
c.setOpaque(true);
if ( rowStatus[row] != -1 ) {
if ( rowStatus[row] == ThumbAndMetaResultViewer.ACTION_DELETE ){
c.setBackground( DELETE_COLOR );
c.setForeground( Color.black );
else {
c.setBackground( NULL_COLOR );
c.setForeground( Color.black);
return c;
</pre>

I don't see that you are calling setIcon anywhere in the code - you need to make a change:
c.setOpaque(true);
// Add this  ------------8<-----------
if (value instanceof Icon)
    c.setIcon((Icon) value);
// ---------------------8=-----------
if ( rowStatus[row] != -1 ) {
...Mitch Goldstein
Author, Hardcore JFC (Cambridge Univ Press)
[email protected]

Similar Messages

  • Field in portal table for the text contained in an uploaded file

    I have uploaded a file of base item type file into release 2 of the portal.
    Does anyone know which table the clob field for the text contained in
    the uploaded file is stored?
    Thanks,
    Suzanne

    Hi,
    When you run the Search hep is it giving the description or not
    You have to create the serarch help with both the fieldname and its description field then we cna the values. Or
    Try to mantain the text table for this field and get the data.
    Get the valeusinto drop drown with this table Or create the SearchHelp for this text table
    Regards
    Lekha

  • [svn:fx-trunk] 5353: * Added compiler error for Halo Navigators containing non-Containers

    Revision: 5353
    Author: [email protected]
    Date: 2009-03-17 12:59:06 -0700 (Tue, 17 Mar 2009)
    Log Message:
    * Added compiler error for Halo Navigators containing non-Containers
    as their first level child.
    tests Passed: checkintests
    Needs QA: YES
    Needs DOC: NO
    Bug fixes: SDK-19317
    API Change: NO
    Reviewer: Pete F.
    Code-level description of changes:
    compiler/mxml/lang/StandardDefs.java
    Added getContainerPackage(), isHaloNavigator(), CLASS_VIEWSTACK,
    CLASS_ACCORDION, and PACKAGE_MX_CONTAINERS.
    compiler/mxml/builder/ComponentBuilder.java
    Modified
    ComponentBuilder.ComponentAttributeHandler.nestedDeclaration() to
    report an error if a non-container is declared as a child of a
    Halo navigator.
    compiler_en.properties
    Added HaloNavigatorsRequireHaloContainerChildren message.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-19317
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.jav a
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler_en.properties

  • Acknowledgment for PO item contains quantity variance

    hi friends,
    My scenario is to create a Purchase Order on Client A and through the Output Control I need to create a Sales Order on Client B and send the Order Acknowledgement(ORDRSP) for the Corresponding Purchase Order.
    Iam through upto creating a Sales Order but when iam trying to send the Acknowledgement using the Output Control
    Iam getting an error :
    Confirmation control key missing for PO item .
    when I attach a Confirmation Control Key while Creating PO
    It is giving an error :
    Acknowledgment for PO item contains quantity variance
    Please respond quickly.
    Thanks in advance.
    Ganga Prasad

    Hi,
    check both IDOC, the ORDERS and the ORDRSP, whether they contain the same quantity.
    Maybe the SD-part is rounding up your order, e.g. you order 5 bottles of wine and the wine is only sold in 6 bottle packadges.
    If you find my answer useful, please don't forget the reward.
    Regards,
    Juergen

  • Customised xpath expression for does not contain

    Hi folks,
    Is there a customised symbol for xpath expression for "does not contain" . cant seem to find it in the xpath operators.
    Thanks
    Pratichi

    Hi,
    Refer the below link:
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/15981541f7648ee10000000a1553f7/content.htm
    -Supriya.

  • Exit For Each Loop Container

    Is there a way in a foreach loop container to exit if the foreach loop container has been executing for a certain amount of time?
    Thanks.

    Hi miguelh,
    Based on my research, there is no such a property for Foreach Loop Container to achieve this requirement. Because the Foreach Loop Container itself execute the times based on the files loop.
    After testing the issue in my environment, we can add a Script Task inside the top of Foreach Loop Container to count the execute times, then add a precedence constraint with the count times on your tasks to limit the execute times. For more details, please
    see:
    Add a variable named Count in the package.
    Drag a Script Task inside the top of Foreach Loop Container.
    Double-click the Script Task, change ScriptLanguage to Microsoft Visual Basic 2010, then add User::Count as ReadOnlyVariables.
    Click Edit Script to add the code like below:
     Public Sub Main()
            ' Add your code here
            Dts.Variables("User::Count").Value = Dts.Variables("User::Count").Value + 1
            Dts.TaskResult = ScriptResults.Success
        End Sub
    Add a precedence constraint with Constraint options below:
    The following screenshot is for your reference:
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • SSIS For Each Loop Container

    Hello All,
    I have some files within sub folders. Below is the layout 
    C:\Source\01012015\Sample_1.csv
    C:\Source\01012015\Sample_2.csv
    C:\Source\02012015\Sample_1.csv
    C:\Source\02012015\Sample_2.csv
    C:\Source\03012015\Sample_1.csv
    C:\Source\03012015\Sample_2.csv
    I want
    to copy entire folder contents from source to destination including the sub folders and the files
    I am using for each loop container which reads the files form 01012015 folder, is there any way to read
    all the files from each and every folder(01012015, 02012015,03012015)?
    The destination should be like this. 
    C:\Archive\01012015\Sample_1.csv
    C:\Archive\01012015\Sample_2.csv
    C:\Archive\02012015\Sample_1.csv
    C:\Archive\02012015\Sample_2.csv
    C:\Archive\03012015\Sample_1.csv
    C:\Archive\03012015\Sample_2.csv
    Thanks, Shyam.

    Hi Shyam,
    According to your description, you want to copy entire folder contents including the sub folders and the files from source to destination.
    Based on my research, we should use Foreach File Container together with File System Task to achieve your requirement. For more details, please refer to the following links:
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/4d99ebef-df43-44ad-9794-1d729cbf52e9/ssis-foreach-loop-copy-within-subfolders
    http://www.sql-programmers.com/for-each-loop-container.aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Is it possible to set a minimum height for a DIV container?

    Hello fellow developers,
    I wonder if it is possible to set a minimum height or a fixed height for a DIV container (P container, SPAN conrainer) like in HTML?
    Thank you!

    Thank you, Robin!
    But is it somehow possible to reserve a portion of space in the text flow so that later I can put a movie clip over this open space?
    (In HTML I would create a fixed dimension DIV element for this purpose and add its contents later.)

  • GR (MIGO) for Inbound Dely Containing HU

    Hi
    I am trying to create GR for Inbound Dely containing the HU through MIGO and not VL32n , it is throwing the error
    Packing can only be updated via inbound delivery dialog
    Message no. VLA311
    We are into ECC 6.0 and it seems that SAP NOte 1384533 has already been implemented , but still I dont see the VLA 311 message in System Messages under the Logistic Execution path of SPRO.
    I have been reading the SAP Note 199703, but when I set the GR Assignment field of the Conf Control to blank and remove the movt type for Dely Item Cat ELN , it doesnt allow me to create HU in the Inb Dely, although it allows me to create a GR for the Inbound Dely through MIGO .
    Can you please help me in overcoming the prob.
    REgards,
    Binayak

    Hello Diwakar,
    I checked the settings as you suggested.
    1. Goods Receipt for Inbound delivery is active with mvt type 101 in the Enjoy transaction config
    2. For ELN Delivery item category, the 'No Batch Check' check box is flagged. This I think is right because the batch will not exist at the time of inbound delivery creation. Hence we have to set this flag.  This is as per the standard SAP documentation for this flag
    ID: No batch check
    Controls whether the system checks that the batch entered in the delivery exists.
    Procedure
    If you do not want the system to check the batch, select the field.
    Use
    It makes sense not to carry out a check if the batch entered does not (or does not yet) exist in the system. This happens, for example, when you create an inbound delivery. The same applies if you use work with the R/2-R/3 link and the batch only exists in the local system.
    I have created an OSS message and will wait for SAP to answer this. Meanwhile thanks a lot for all your help and guidance.
    regards
    Venkat

  • Why do I keep getting a Norton AV pop up message "High CPU useage for plug in container on Firefox"?

    Norton keeps giving me a lower right hand pop up comment “High CPU usage for plug in container on Firefox." Is there something I need to set to fix this? Should I be concerned? Sometimes this occurs with no other application running.

    IMO, the detection threshold is set too low in that Norton app. Contact Norton support to find out how to set it higher, or how to turn it off.
    Or quit using Norton. ''I hate the garbage they sell. IMO, it is good for one thing, making money for retailer's and for helping PC techs make money fixing what it does to PC's their customers bring in for repairs.''
    http://community.norton.com/norton/

  • Class for creating the container in web dympro like include INCLUDE OBJECT

    Hi how can we use the macros swc_container. swc_set*** .. etc in webdynpro . ??
    I have to pass some vaules to the event container .
    As we cant user includes in webdynpro is there a class to carry out the same task .
    i.e;Class for creating the container in web dympro like include INCLUDE <OBJECT> or INCLUDE <cntn01>.
    Thanks ,
    naval Bhatt

    Hi,
    You had the same question in worfklow forum. I suggest you to include your non-OO-compliant code to for example a function module. OR even better, you might want to take a look to function modules SAP_WAPI*. There are plenty of standard functions, which you can use to do the same things as the macros you are now trying to use. For example raising workflow events, etc.
    Regards,
    Karri

  • The MDX function CURRENTMEMBER failed because the coordinate for the attribute contains a set

     
    How to handle this error: The MDX function CURRENTMEMBER failed because the coordinate for the attribute contains a set. when executing MDX query:
    SELECT (
    { [Measures].[Amount]}
    )ON COLUMNS,
    [OrganizationUnits].[Description].[Description].MEMBERS,
    [OrganizationUnits].[IsCURRENT].[IsCURRENT]
    ) ON ROWS
    FROM
    (SELECT [OrganizationUnits].[Description] ON 0
    FROM
    [CubeName]
    WHERE(
    {[OrganizationUnits].[Description].&[Unit1],[OrganizationUnits].[Description].&[Unit2]}
    Thanks!!

    Hi Arth81,
    Please try the query below.
    WITH MEMBER MEASURES.IsCURRENT AS [OrganizationUnits].[IsCURRENT].[IsCURRENT].CURRENTMEMBER.NAME
    SELECT
    { [Measures].[Amount],MEASURES.IsCURRENT} ON COLUMNS,
    {[OrganizationUnits].[Description].[Description].MEMBERS,
    } ON ROWS
    FROM
    (SELECT [OrganizationUnits].[Description].MEMBERS ON 0
    FROM
    [CubeName]
    WHERE(
    {[OrganizationUnits].[Description].&[Unit1],[OrganizationUnits].[Description].&[Unit2]}
    Regards,
    Charlie Liao
    TechNet Community Support

  • For each loop container executing multiple times....

    Hi,
    We are using SQL SERVER version 2005.
    I am having a For each loop container and inside that container there are multiple Sequence containers and inside each sequence containers there are Execute SQL Tasks (which are just stored procedures).
    Now, when i run sequence containers individually they are running perfectly fine.
    But when I run the whole For each loop container, it is just running and running multiple times without ending the process.
    I really couldnt figure out what would be the issue?
    Any ideas????
    Thanks....

    Hi grk666,
    To check whether the values stored in the object type variable are correct, you can disable all the Sequence Containers within the Foreach Loop Container, and add a Script Task with the following code to display the string type variable value (supposing
    you use the string type variable StrVar to store the value retrieved from the object variable):
    MsgBox(Dts.Variables(“StrVar”).Value.ToString())
    It would be helpful if you could post a screenshot to show the package execution at runtime in BIDS.
    Regards,
    Mike Yin
    TechNet Community Support

  • The settings for accounting integration contain errors

    The settings for accounting integration contain errors
    Message no. DPR_FIN_GECCO004
    System Response
    The accounting functions are not available.
    Procedure
    Check the following in Customizing for Collaboration Projects:
    Did you assign an object type to the project type for communicating with the accounting system? See the IMG activity Make General Settings.
    Does this object type have the proxy class CL_DPR_OLR3_GECCO (for single-object controlling on internal orders) or CL_DPR_OLR3_WBSELEMENT (for single-object controlling on WBS elements)? See the IMG activity Define Object Types for Object Links.
    Has an RFC destination been entered in this object type? See the IMG activity Define Object Types for Object Links.
    In the project type did you choose the confirmation setting regarding 'Time Recording for' to match the integration scenario? See the IMG activity Define Project Types. For example, time recording for a role is not permitted in a structure-based scenario.
    All the steps mentioned in the in the above error have been verfied and are correct but the error is still existing. Is there anything that I am missing here?

    Hi SAP USER123 ,
    Actually the description of the messages should the reason of the problem. Please double check the settings again one by one.
    If the problem still remains, you can open a customer message for help.
    Kind regards
    Zhenbo

  • CProject - The settings for Accounting integration contain errors

    Hi,
    I got error message "The settings for Accounting integration contain errors"  from cProject page when I choose controlling method  (Project Role, Automatic).
    If I choose other controlling method then this the error message disappear.
    Maybe some thing wrong while setup Role Type?.
    Please help!
    Thank you
    Long Nguyen

    Hi,
    Are you using MULTILEVEL CONTROLLING ( PROJECT ROLE , AUTOMATIC)
    that means
    Multilevel Controlling (Project Role, <b>Automatic</b>): In this method, the system automatically creates a PS project definition for the project definition and a WBS billing element at the first level of the hierarchy. More WBS elements are created for the project roles of the cProjects projects.
    Multilevel Controlling (Project Role, <b>Manua</b>l): In this method, a user has to create the PS project in the ERP system. The user then has to assign the project roles of a cProjects project to the WBS elements of this PS project manually in cProjects.
    thanks
    sunil

Maybe you are looking for

  • Metrics - How they are defined / calculated ?

    My customer is analyzing a couple of standard reports. They are asking for the definition or calculation for some metrics like: a) In the Active Campaign status report ROI - Return over investment Cost per closed sale Cost per leadb) In the Team Sale

  • Mail application crashes after 2.0 update

    Hi, After installing 2.0 (which worked without troubles) I cannot use the mail application anymore. Everytime I start it I see the program open, but completely empty - no folders, messages, etc ... I next tried to deactivate the mail account to see i

  • Acrobat X and Yosemite Issues

    I have been using acrobat 10 and OS Mavericks to manage my office documents using a Fujitsu scanner. After I upgraded to OS Yosemite, I have been unable to print any of the documents that I have scanned. The image of the doc will show up on the print

  • Please help with slide show creation

    I purchased the bundle of photoshop and premier elements 10.  I was trying to create a slide show and was informed that photoshop elements 10 does not come with a slide show for APPLE.  now I hae been told I can creat a slide show in premier.  can an

  • Permanently blocking a caller regardless of the "area code"

    Hello.  I can't seem to find anything similar to this in the archives.  There is a pest caller calling me that has a number very similar to my own, only the last 2 digits are different, the rest looks like my phone number.  Originally they started ca