Set the color of a row depending the value of the column in JTable?

Hi All,
I have a JTable that add rows when the user clicks on the button. In this way there can be any no. of rows in my table. My table contains five columns. When a new row is added , it is added with new data each time. Also the data of the rows keep on changing time to time.
My problem is that when the data value for the third column comes out to be -ve then color of the row should be red and if its value is +ve then the color of the row should be green.
I have tried for this in the way but it is not working properly.
public Component prepareRenderer(TableCellRenderer renderer,int rowIndex, int vColIndex)
     Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
if(change<0 && rowIndex<table.getRowCount() )
          c.setForeground(Color.red);
          c.setFont(new Font("TimesRoman",Font.PLAIN,11));
else if(change>0&&rowIndex<table.getRowCount() )
c.setForeground(new Color(20,220,20));
     c.setFont(new Font("TimesRoman",Font.PLAIN,11));
return c;
where change is the value of the third column.
Any help is highly appreciated.
Thanx in advance.
Regards,
Har Krishan

Why do you have 3 postings on this topic all made within minutes of each other? (see [url http://forum.java.sun.com/thread.jspa?threadID=574547&tstart=0]here and [url http://forum.java.sun.com/thread.jspa?threadID=574543&tstart=0]here).
If you created a post by mistake then make a comment in the posting so people don't waste there time attempting to answer an old post.
where change is the value of the third column.How do you know "change" is the value of the third column? Did you use a System.out.println(...) to verify this.
A better approach is to use:
Object o = table.getModel().getValueAt(row, 2);
Then convert the Object to an int value and do your testing. This way you are guaranteed to be testing against the correct value.

Similar Messages

  • How to change the color of specific row in ALV tree

    Hi,
    I m using method set_table_for_first_display of a class CL_GUI_ALV_TREE.
    The req is to change the color of specific row. Now can anybody tell me how to change the color of ALV tree. As in ALV tree and in this method 'set_table_for_first_display', there is no parameter IS_Layout.
    Pls suggest...

    hi
    hope this code will help you.
    Reward if help.
    REPORT zsharad_test1.
    TABLES: ekko.
    TYPE-POOLS: slis. "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
    ebeln TYPE ekpo-ebeln,
    ebelp TYPE ekpo-ebelp,
    statu TYPE ekpo-statu,
    aedat TYPE ekpo-aedat,
    matnr TYPE ekpo-matnr,
    menge TYPE ekpo-menge,
    meins TYPE ekpo-meins,
    netpr TYPE ekpo-netpr,
    peinh TYPE ekpo-peinh,
    line_color(4) TYPE c, "Used to store row color attributes
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
    wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    gd_tab_group TYPE slis_t_sp_group_alv,
    gd_layout TYPE slis_layout_alv,
    gd_repid LIKE sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    PERFORM data_retrieval.
    PERFORM build_fieldcatalog.
    PERFORM build_layout.
    PERFORM display_alv_report.
    *& Form BUILD_FIELDCATALOG
    Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
    I.e. Field type may be required in-order for
    the 'TOTAL' function to work.
    fieldcatalog-fieldname = 'EBELN'.
    fieldcatalog-seltext_m = 'Purchase Order'.
    fieldcatalog-col_pos = 0.
    fieldcatalog-outputlen = 10.
    fieldcatalog-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    fieldcatalog-do_sum = 'X'.
    fieldcatalog-no_zero = 'X'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'EBELP'.
    fieldcatalog-seltext_m = 'PO Item'.
    fieldcatalog-col_pos = 1.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'STATU'.
    fieldcatalog-seltext_m = 'Status'.
    fieldcatalog-col_pos = 2.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'AEDAT'.
    fieldcatalog-seltext_m = 'Item change date'.
    fieldcatalog-col_pos = 3.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'Material Number'.
    fieldcatalog-col_pos = 4.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'MENGE'.
    fieldcatalog-seltext_m = 'PO quantity'.
    fieldcatalog-col_pos = 5.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'MEINS'.
    fieldcatalog-seltext_m = 'Order Unit'.
    fieldcatalog-col_pos = 6.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'NETPR'.
    fieldcatalog-seltext_m = 'Net Price'.
    fieldcatalog-col_pos = 7.
    fieldcatalog-outputlen = 15.
    fieldcatalog-datatype = 'CURR'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'PEINH'.
    fieldcatalog-seltext_m = 'Price Unit'.
    fieldcatalog-col_pos = 8.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    ENDFORM. " BUILD_FIELDCATALOG
    *& Form BUILD_LAYOUT
    Build layout for ALV grid report
    FORM build_layout.
    gd_layout-no_input = 'X'.
    gd_layout-colwidth_optimize = 'X'.
    gd_layout-totals_text = 'Totals'(201).
    Set layout field for row attributes(i.e. color)
    gd_layout-info_fieldname = 'LINE_COLOR'.
    gd_layout-totals_only = 'X'.
    gd_layout-f2code = 'DISP'. "Sets fcode for when double
    "click(press f2)
    gd_layout-zebra = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text = 'helllllo'.
    ENDFORM. " BUILD_LAYOUT
    *& Form DISPLAY_ALV_REPORT
    Display report using ALV grid
    FORM display_alv_report.
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = gd_repid
    i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
    i_callback_user_command = 'USER_COMMAND'
    i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fieldcatalog[]
    it_special_groups = gd_tabgroup
    IT_EVENTS = GT_XEVENTS
    i_save = 'X'
    is_variant = z_template
    TABLES
    t_outtab = it_ekko
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " DISPLAY_ALV_REPORT
    *& Form DATA_RETRIEVAL
    Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
    DATA: ld_color(1) TYPE c.
    SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
    UP TO 10 ROWS
    FROM ekpo
    INTO TABLE it_ekko.
    *Populate field with color attributes
    LOOP AT it_ekko INTO wa_ekko.
    Populate color variable with colour properties
    Char 1 = C (This is a color property)
    Char 2 = 3 (Color codes: 1 - 7)
    Char 3 = Intensified on/off ( 1 or 0 )
    Char 4 = Inverse display on/off ( 1 or 0 )
    i.e. wa_ekko-line_color = 'C410'
    ld_color = ld_color + 1.
    Only 7 colours so need to reset color value
    IF ld_color = 8.
    ld_color = 1.
    ENDIF.
    CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
    wa_ekko-line_color = 'C410'.
    MODIFY it_ekko FROM wa_ekko.
    ENDLOOP.
    ENDFORM. " DATA_RETRIEVAL

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • In Word I want to bring the color box out as a separate box in the screen.  I used to could do this, but I no longer can.  Any help?

    In Word I want to bring the color box out as a separate box in the screen.  I used to could do this, but I no longer can.  Any help?

    you cannot create folders for photos on the iPod Touch. you must currently do it on a computer by syncing the iPod with a photo program, and creating folders within that program and syncing them over. kinda stupid, but hopefully they'll fix it in an update soon.

  • I need to create buttons in which the color changes, and stays on after you release the button

    I need to create buttons in which the color changes, and stays on after you release the button. The hard part is the buttons must change independently of each other.
    To get an idea of some of things I’ve tried I’ve tried making the movie with two frames.
    When I click the button it switched to the new frame which would show a movie clip,
    Unfortunately all buttons would change color together and don’t see how to make it so that they change independently.

    you must use movieclip buttons and code for their frame changes.

  • I brought a new ipad mini with retina. The color saturation is too low to me, especially the purple. My wife started to complain because the color is really different from iphone and ipad. Can user adjust that?

    I brought a new ipad mini with retina. The color saturation is too low to me, especially the purple. My wife started to complain because the color is really different from inphone and ipad. Can user adjust that?

    Other than a couple of minor adjustments, such as the one that Diavonex suggested above, there is nothing that a user can do in settings to adjust color. There is no way to calibrate the color like you can do with a computer monitor.

  • The "SignFile" task was not given a value for the required parameter "CertificateThumbprint"

    We have a line of business app which is deployed via clickonce. I can build and publish the application without any problems but when I try to use Continuous Integration (Build each check-in) I get the following error:
    2>C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(3450,5):
    error MSB4044:
    The "SignFile" task was not given a value for the required parameter "CertificateThumbprint".
    [C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj]
    Done executing task "SignFile" -- FAILED.
    We sign the application (to be more specific: the ClickOnce manifest) using a code signing certificate which is registered in the AD as Trusted Publisher.
    The Certificate is stored in Certificate store on my local workstation. The Certificate is also in the certificate store of the build server (1. In the Personal Store, 2. in the Personal store of the TFSBuildServiceHost Service Account and 3. in the Personal
    store of the tfs/build server itself).
    Where are using Visual Studio 2013 Update 4, C#, .Net 4.5 and TFS 2013 Update 4.
    I have no clue what causes this error, any help is appreciated.

    I installed the
    Windows Software Development Kit (SDK) for Windows 8 and now I can build the solution via command line.
    "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe" C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln
    "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln
    But the TFS Build still fails.
    Here is the error output gathered from the tfsbuild logfile:
    Task "AL"
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\AL.exe /culture:de /out:obj\Debug\de\Pulse.resources.dll /platform:AnyCPU /template:obj\Debug\Pulse.exe /embed:obj\Debug\Pulse.View.Localization.CreditsView.de.resources /embed:obj\Debug\Pulse.View.Localization.PulseMainWindow.de.resources
    Microsoft (R) Assembly Linker version 12.0.20806.33440
    Copyright (C) Microsoft Corporation. All rights reserved.
    Done executing task "AL".
    2>Done building target "GenerateSatelliteAssemblies" in project "Pulse.csproj".
    2>Target "CreateSatelliteAssemblies" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "CoreBuild" depends on it):
    2>Done building target "CreateSatelliteAssemblies" in project "Pulse.csproj".
    Target "SetWin32ManifestProperties" skipped. Previously built successfully.
    Target "_DeploymentComputeNativeManifestInfo" skipped, due to false condition; ('$(GenerateClickOnceManifests)'!='true') was evaluated as ('true'!='true').
    2>Target "CleanPublishFolder" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "_DeploymentComputeClickOnceManifestInfo" depends on it):
    Task "RemoveDir" skipped, due to false condition; ('$(PublishDir)'=='$(OutputPath)app.publish\' and Exists('$(PublishDir)')) was evaluated as ('bin\Debug\app.publish\'=='bin\Debug\app.publish\' and Exists('bin\Debug\app.publish\')).
    2>Done building target "CleanPublishFolder" in project "Pulse.csproj".
    Target "_DeploymentGenerateTrustInfo" skipped, due to false condition; ('$(TargetZone)'!='') was evaluated as (''!='').
    2>Target "_DeploymentComputeClickOnceManifestInfo" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "GenerateApplicationManifest" depends on it):
    Task "Copy"
    Creating directory "bin\Debug\app.publish".
    Copying file from "obj\Debug\Pulse.exe" to "bin\Debug\app.publish\Pulse.exe".
    Done executing task "Copy".
    Using "SignFile" task from assembly "Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    Task "SignFile"
    2>C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(3450,5): error MSB4044: The "SignFile" task was not given a value for the required parameter "CertificateThumbprint". [C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj]
    Done executing task "SignFile" -- FAILED.
    2>Done building target "_DeploymentComputeClickOnceManifestInfo" in project "Pulse.csproj" -- FAILED.
    2>Target "_CheckForCompileOutputs" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "_CleanGetCurrentAndPriorFileWrites" depends on it):
    2>Done building target "_CheckForCompileOutputs" in project "Pulse.csproj".
    Target "_SGenCheckForOutputs" skipped, due to false condition; ('$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')) was evaluated as ('Off' == 'On' or (''!='' and 'Off' == 'Auto')).
    2>Target "_CleanGetCurrentAndPriorFileWrites" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "_CleanRecordFileWrites" depends on it):
    Task "ReadLinesFromFile"
    Done executing task "ReadLinesFromFile".
    Task "ConvertToAbsolutePath"
    Done executing task "ConvertToAbsolutePath".
    Task "FindUnderPath"
    Comparison path is "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse".
    Done executing task "FindUnderPath".
    Task "FindUnderPath"
    Comparison path is "C:\Builds\1\Pulse\DefaultBuild\bin\".
    Done executing task "FindUnderPath".
    Task "FindUnderPath"
    Comparison path is "obj\Debug\".
    Done executing task "FindUnderPath".
    Task "RemoveDuplicates"
    Done executing task "RemoveDuplicates".
    2>Done building target "_CleanGetCurrentAndPriorFileWrites" in project "Pulse.csproj".
    2>Target "_CleanRecordFileWrites" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (target "CoreBuild" depends on it):
    Task "RemoveDuplicates"
    Done executing task "RemoveDuplicates".
    Task "MakeDir"
    Done executing task "MakeDir".
    Task "WriteLinesToFile"
    Done executing task "WriteLinesToFile".
    2>Done building target "_CleanRecordFileWrites" in project "Pulse.csproj".
    2>Done Building Project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (default targets) -- FAILED.
    1>Done executing task "MSBuild" -- FAILED.
    1>Done building target "Build" in project "Pulse.sln" -- FAILED.
    1>Done Building Project "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln" (default targets) -- FAILED.
    Build FAILED.
    "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse.sln" (default target) (1) ->
    "C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj" (default target) (2) ->
    (_DeploymentComputeClickOnceManifestInfo target) ->
    C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(3450,5): error MSB4044: The "SignFile" task was not given a value for the required parameter "CertificateThumbprint". [C:\Builds\1\Pulse\DefaultBuild\src\Pulse\Pulse\Pulse.csproj]
    0 Warning(s)
    1 Error(s)

  • The LOV modal window could not return value to the base page

    when practicing the "create1" task in tutorial, met an issue.
    when create an employee, manageName is a messageLovInput and managerID is a messageTextInput.
    The issue is the LOV modal window could not return value to the mangerName, but can return to managerID .
    If I remove the data boud porperties of the managerName (the bc4j porperties of view name-EmpFullVO and view attribute-MgrName), the lov works fine.
    What is the reason?

    James I would suggest to read the LOV topic in OAF developers' guide. Lov mappings are responsible for bringing pop up values to base page in LOV.
    --Mukul                                                                                                                                                                                                                                                                                                                                                   

  • How to set  color of a  row depending on the value of column in JTable?

    Hi All,
    I have a JTable that add rows when the user clicks on the button. In this way there can be any no. of rows in my table. My table contains five columns. When a new row is added , it is added with new data each time. Also the data of the rows keep on changing time to time.
    My problem is that when the data value for the third column comes out to be -ve then color of the row should be red and if its value is +ve then the color of the row should be green.
    I have tried for this in the way but it is not working properly.
    public Component prepareRenderer(TableCellRenderer renderer,int rowIndex, int vColIndex)
         Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
    if(rowIndex<table.getRowCount() && change<0 )
              c.setForeground(Color.red);
              c.setFont(new Font("TimesRoman",Font.PLAIN,11));
    else if(rowIndex<table.getRowCount() && change>0)
    c.setForeground(new Color(20,220,20));
         c.setFont(new Font("TimesRoman",Font.PLAIN,11));
    return c;
    where change is the value of the third column.
    Any help is highly appreciated.
    Thanx in advance.
    Regards,
    Har Krishan

    Perhaps you'll find this link useful. It gives a general idea of how you can create and adjust your custom renderer:
    http://www.senun.com/Left/Programming/Java_old/Examples_swing/JTableExamples4.html
    Hope it helps.
    Eugene

  • How do I set an Apex mulri-row reports form value for the specifc current row using Javascript?

    I have a multi-row region based on a table in which I have two particular columns of interest.  The first has an LOV defined for which I have set up a pick-list of codes associated with the item's status as "OK" or having some problem, for which there are a small number of set codes associated.  Most rows will be OK, but when there is a problem, the pick-list will be used.
    When that pick list has been used, there is an optional "comments" column that can be filled in.  I want my screen to dynamically enable/disable a pushbutton that links to the comment based on the code.  This being row-based, the push-button needs enabling or disabling by row, not as a whole "conditional column".  That bit is ok, I think, but I don't know and can't find the syntax for how within the javascript onchange function I set the current row value for a different column to the one that triggered it.
    My header function (that doesn't work) is going to be something like this (where the status column LOV having a value = 6 means "OK").  Note I'm using alert for a debug mechamism.  The $s line is my failed attempt to set he column value, here with a hard-coded string "Changed COMMENTS":
    <script type="text/javascript">
    function doActivateButton(object)
      if(parseInt(object.value)!='6')
        alert('It is not 6!');
        $s('#COMMENTS','Changed COMMENTS','Changed COMMENTS',TRUE);
      else
        alert('It is 6, you know!');
    </script>
    Ideally, I want any existing comments blanked if the user picks "OK" (6) as the new status, whereas for debug above I'm setting the hardcoded debug string.  You will probably also note I realise I haven't properly understood the purpose of the third parameter in the $s API.
    (This is a reports region, by the way.  A detail block, in forms-speak, with a header block above it.)
    Thanks for any assistance.
    Mark

    Sorry, versions are: Apex 4.1 on Oracle RDBMS 11.2.

  • Can you change the color of a row in a SUD

    Is it possible to change the color in a selected row in a SUD? I have multiple tables in my SUD were the user can select multiple rows from each table. The problem is that when the user selects rows in another table the last one selected in the previous table is not hi-lighted. I thought that if I change the color of the row when selected the user can see all the selections once he/she goes to another table.
    Thanks,
    AJL

    Hi AJL,
    There is no way to color rows of the table control in a SUDialog. You could consider using the ActiveX container control and using the Microsoft ActiveX table control, which might have that functionality. Note though, that then you need to either ensure that control is always on all your client machines or make provisions for it to be installed/registered.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Since installing yosemite the colors are washed out and whenever I restart the machine it reverts to the yosemite screensaver even though i have set a different desktop picture.

    Since i installed yosemite, the some parts of the screen can hardly be seen and whenever I restart the desktop display reverts back to the yosemite screensaver which I have never selected.  Do i need to reinstall or what.

    Please do the following.<br><br>
    #In the location bar where you normally type in a web address, type '''about:config''' and hit Enter.<br><br>
    #If you see a window which says "This might void your warranty!", click the button which says "I'll be careful, I promise" so you can continue with the next step.<br><br>
    #In the filter at the top, type: '''keyword.URL'''<br><br>
    #Double click it and remove whatever's in there and replace it with http://www.google.com.au/search?q= and then click OK.<br><br>
    #Close the tab
    The URL to add in "keyword.URL" becomes a link in this post, so right click it and choose "Copy Link Location" to copy it to the Windows clipboard. Then hit CTRL+V to paste it. Saves you having to type the whole thing.
    '''To reset your home page, do the following'''.<br><br>
    * Go to the site you want to set as your homepage.<br><br>
    * Click the Firefox button, go to '''Options '''| '''Options '''| '''General'''.<br><br>
    * Make sure it says "''Show My Homepage''" in the first dropdown menu.<br><br>
    * Click the button called "'''Use Current Pages'''" to set the homepage to the one you have on the screen.<br><br>
    If this suggestion resolves the problem for you, please click the '''Solved it''' button next to this post after you log in into the forum. This will help others searching for a solution to the same problem.
    Thanks.

  • Setting background color for a row

    hello all,
    how can set a particular row with background color, say for button click
    i will say the row number, than the that row should be colored.
    give me suggestion
    thanks
    daya

    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    http://javaalmanac.com/egs/javax.swing.table/CustRend.html

  • In working on a simple home budget,  how can I change the color of a negative number to red,  during the period the number is negative.    Thanks,

    Using Numbers spreadsheet and In working on a simple home budget,  how can I change the color of a number to RED when it  comes up negative.  (only during the time that it's negative)  Thanks,  ( I hope I did this right!!) 

    The Inspector offers choices of format for negative numbers when you choose Number of Currency as the format for a cell. Also offered when the format is set to Automatic, IF the selected cell(s) contain number(s).
    The choices are in the pop-up menu beside the box for number of decimal places.
    Regards,
    Barry

  • Adobe DNG converter is corrupting NEF files. The color is way off and it's not the camera white balance.

    I was using the converter for a few months and it was working fine. Now it will convert the files, but the color is really messed. I know it is not the white balance, because the same files convert fine to TIF files through Nikon's software. I am using this converter for Nikon d610 NEF files. Here's a sample DNG and the same image in TIF. Can anyone help? Thanks!

    When you use the DNG Converter to make a DNG from an NEF, the DNG Converter applies the default Camera Raw settings.  When I open your DNG it looks fine, but when you open it, it looks off.  That is because you've some how set your Camera Raw defaults to have a bunch of customized settings specific to a particular picture, instead of having them all be normal settings.  Below you'll see what Photoshop is saying the settings of the DNG-Converted-JPG are, with the non-defaults marked in bold.  The main problems are the WB being custom and a bunch of HSL setting changes.
    Here is what Photoshop reports that the JPG was created using:
          <rdf:Description rdf:about=""
                xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">
             <crs:RawFileName>hug_8290_0215_1.dng</crs:RawFileName>
             <crs:Version>6.0</crs:Version>
             <crs:ProcessVersion>5.7</crs:ProcessVersion>
             <crs:WhiteBalance>Custom</crs:WhiteBalance>
             <crs:Temperature>5732</crs:Temperature>
             <crs:Tint>+26</crs:Tint>
             <crs:Exposure>0.00</crs:Exposure>
             <crs:Shadows>5</crs:Shadows>
             <crs:Brightness>+50</crs:Brightness>
             <crs:Contrast>+25</crs:Contrast>
             <crs:Saturation>-4</crs:Saturation>
             <crs:Sharpness>90</crs:Sharpness>
             <crs:LuminanceSmoothing>0</crs:LuminanceSmoothing>
             <crs:ColorNoiseReduction>25</crs:ColorNoiseReduction>
             <crs:ChromaticAberrationR>0</crs:ChromaticAberrationR>
             <crs:ChromaticAberrationB>0</crs:ChromaticAberrationB>
             <crs:VignetteAmount>0</crs:VignetteAmount>
             <crs:ShadowTint>0</crs:ShadowTint>
             <crs:RedHue>0</crs:RedHue>
             <crs:RedSaturation>+11</crs:RedSaturation>
             <crs:GreenHue>0</crs:GreenHue>
             <crs:GreenSaturation>0</crs:GreenSaturation>
             <crs:BlueHue>+12</crs:BlueHue>
             <crs:BlueSaturation>+2</crs:BlueSaturation>
             <crs:FillLight>0</crs:FillLight>
             <crs:Vibrance>-6</crs:Vibrance>
             <crs:HighlightRecovery>0</crs:HighlightRecovery>
             <crs:Clarity>0</crs:Clarity>
             <crs:Defringe>0</crs:Defringe>
             <crs:HueAdjustmentRed>0</crs:HueAdjustmentRed>
             <crs:HueAdjustmentOrange>0</crs:HueAdjustmentOrange>
             <crs:HueAdjustmentYellow>+1</crs:HueAdjustmentYellow>
             <crs:HueAdjustmentGreen>+5</crs:HueAdjustmentGreen>
             <crs:HueAdjustmentAqua>0</crs:HueAdjustmentAqua>
             <crs:HueAdjustmentBlue>-9</crs:HueAdjustmentBlue>
             <crs:HueAdjustmentPurple>0</crs:HueAdjustmentPurple>
             <crs:HueAdjustmentMagenta>0</crs:HueAdjustmentMagenta>
             <crs:SaturationAdjustmentRed>-2</crs:SaturationAdjustmentRed>
             <crs:SaturationAdjustmentOrange>+14</crs:SaturationAdjustmentOrange>
             <crs:SaturationAdjustmentYellow>+25</crs:SaturationAdjustmentYellow>
             <crs:SaturationAdjustmentGreen>+26</crs:SaturationAdjustmentGreen>
             <crs:SaturationAdjustmentAqua>0</crs:SaturationAdjustmentAqua>
             <crs:SaturationAdjustmentBlue>+32</crs:SaturationAdjustmentBlue>
             <crs:SaturationAdjustmentPurple>0</crs:SaturationAdjustmentPurple>
             <crs:SaturationAdjustmentMagenta>0</crs:SaturationAdjustmentMagenta>
             <crs:LuminanceAdjustmentRed>+40</crs:LuminanceAdjustmentRed>
             <crs:LuminanceAdjustmentOrange>+13</crs:LuminanceAdjustmentOrange>
             <crs:LuminanceAdjustmentYellow>+3</crs:LuminanceAdjustmentYellow>
             <crs:LuminanceAdjustmentGreen>+15</crs:LuminanceAdjustmentGreen>
             <crs:LuminanceAdjustmentAqua>+3</crs:LuminanceAdjustmentAqua>
             <crs:LuminanceAdjustmentBlue>+4</crs:LuminanceAdjustmentBlue>
             <crs:LuminanceAdjustmentPurple>0</crs:LuminanceAdjustmentPurple>
             <crs:LuminanceAdjustmentMagenta>0</crs:LuminanceAdjustmentMagenta>
             <crs:SplitToningShadowHue>231</crs:SplitToningShadowHue>
             <crs:SplitToningShadowSaturation>32</crs:SplitToningShadowSaturation>
             <crs:SplitToningHighlightHue>45</crs:SplitToningHighlightHue>
             <crs:SplitToningHighlightSaturation>33</crs:SplitToningHighlightSaturation>
             <crs:SplitToningBalance>+74</crs:SplitToningBalance>
             <crs:ParametricShadows>-39</crs:ParametricShadows>
             <crs:ParametricDarks>-7</crs:ParametricDarks>
             <crs:ParametricLights>-15</crs:ParametricLights>
             <crs:ParametricHighlights>+14</crs:ParametricHighlights>
             <crs:ParametricShadowSplit>25</crs:ParametricShadowSplit>
             <crs:ParametricMidtoneSplit>50</crs:ParametricMidtoneSplit>
             <crs:ParametricHighlightSplit>75</crs:ParametricHighlightSplit>
             <crs:SharpenRadius>+1.0</crs:SharpenRadius>
             <crs:SharpenDetail>25</crs:SharpenDetail>
             <crs:SharpenEdgeMasking>0</crs:SharpenEdgeMasking>
             <crs:PostCropVignetteAmount>-24</crs:PostCropVignetteAmount>
             <crs:PostCropVignetteMidpoint>50</crs:PostCropVignetteMidpoint>
             <crs:PostCropVignetteFeather>97</crs:PostCropVignetteFeather>
             <crs:PostCropVignetteRoundness>0</crs:PostCropVignetteRoundness>
             <crs:PostCropVignetteStyle>1</crs:PostCropVignetteStyle>
             <crs:PostCropVignetteHighlightContrast>0</crs:PostCropVignetteHighlightContrast>
             <crs:GrainAmount>0</crs:GrainAmount>
             <crs:ColorNoiseReductionDetail>50</crs:ColorNoiseReductionDetail>
             <crs:ConvertToGrayscale>False</crs:ConvertToGrayscale>
             <crs:ToneCurveName>Medium Contrast</crs:ToneCurveName>
             <crs:CameraProfile>Adobe Standard</crs:CameraProfile>
             <crs:CameraProfileDigest>51B4314CF8312BA027EF3FC60481FB35</crs:CameraProfileDigest>
             <crs:HasSettings>True</crs:HasSettings>
    To fix the problem you're gonna need to reset your camera raw defaults:
    And then be careful when saving new camera raw defaults with the menu item just above, that your image has the camera raw defaults applied to it, except whatever small change you want to be the new default.

Maybe you are looking for

  • Dates Format in Promts using Session Variables

    Hi Experts, I have an issue in controlling date format in prompts using session variable which I am using to set default value. By default date format is timestamp E.g '2010-12-19 12:00:00 AM'. As per requriement(s) I customized the date format in Re

  • Getting strange messages and Logic won't open PLEASE HELP!

    I haven't opened Logic for a few weeks because I have been out of town. I just tried to open a project and got the message "logic pro has detected a possible conflict between one or more third party midi or audio drivers" and an empty project pops up

  • Ps cc crashes when press print

    i have a trial version of ps cc it crashes when i go to print. What should i do?

  • Tuxedo Runtime issues.

    I am attempting to create a replicated environment of tuxedo on aix. However facing two errors i am not sure if they are different from each other or same: 1) When i attempt buildtms using buildtms -r Oracle_XA -o EPTMS i get the following errors and

  • Incorrect apple ID, not the case...help

    I recently purchased an album on itunes on a macbook pro, and tried to download the same album from the cloud to 3 additional authorized devices, and was told that the original item was not purchased with the same itunes ID.  I recently upgraded to L