ADF: Change of color for each value in the column, according to the State

Hello world

I use Jdev 11 G.
I created an ADF only read the table.
table has 5 columns. (empno, ename, sal, comm, address).

If comm < 0, then I need to display it in the color blue
otherwise have to display in red color.

Note: comm value can be decimal (float).
How to get there?
All responses will be very grateful.

Thank you...

Something like that?

cell color

Arun-

Tags: Java

Similar Questions

  • Different color for each item in the list

    Hi all

    I am currently working with a List component and I am looking to change the color of the font for each item individually. Flex allows you to do this? If so, can someone post a solution. Thank you in advance.






    override the private function data (value: Object): void
    {
    Super.Data = value; EXTREMELY IMPORTANT THAT YOU DO THIS FIRST
    If {(value)
    Examine the value and determine the color
    setStyle ("color", somecolor);
    }
    }
    ]]>




  • the list widget with different colors for each item in the list?

    I'll add a widget list to my interactive color wheel:

    * http://r0k.us/graphics/SIHwheel.html

    It is an old applet, first published in 1998 and older than Swing.

    The list contains the names of color 1 567 which he knows the color values. I want the background color to each element to be one of the named color. The forefront color name text will be white or black, chosen for readability to her background. Basically, I'm hoping to accomplish what the name of this color page did with its list widget HTML-form:

    * http://chir.ag/projects/name-that-color/

    I studied the java.awt.list document:

    * http://download.oracle.com/javase/1.4.2/docs/api/java/awt/List.html

    SetBackground() and setForeground() methods are implemented, but they seem to apply only to the list as a whole. As far as I know, it seems there is no access to list items themselves as components. I hope that I am just missing what is obvious.

    -Rich

    What you want to do can be easily implemented on a JList swing, with the help of a custom converter. I would advise therefore to rewrite your applet in the swing, then use a JList. That way you can skip JUnit is studying just to force your applet awt to do something of awt was neither designed for and focus on swing of things GUI. Below is an example of how you can implement your JList:

    import java.awt.*;
    import java.math.BigInteger;
    import java.util.Arrays;
    import java.util.Comparator;
    
    import javax.swing.*;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    
    public class ColorList {
    
        public static void main(String[] args) {
         SwingUtilities.invokeLater(new Runnable() {
    
             @Override
             public void run() {
              new ColorList().createGUI();
             }
         });
        }
    
        private void createGUI() {
         String[][] array = getArray();
         // sort the array as you wish
         Arrays.sort(array, new Comparator() {
    
             @Override
             public int compare(String[] o1, String[] o2) {
              return o1[1].compareTo(o2[1]);
             }
    
         });
         // create the JList
         final JList list = new JList(array);
         // set some adequate renderer
         list.setCellRenderer(new DefaultListCellRenderer() {
             private static final long serialVersionUID = 1L;
    
             @Override
             public Component getListCellRendererComponent(JList list,
                  Object value, int index, boolean isSelected,
                  boolean cellHasFocus) {
              DefaultListCellRenderer renderer = (DefaultListCellRenderer) super
                   .getListCellRendererComponent(list, value, index,
                        isSelected, cellHasFocus);
              renderer.setText(((String[]) value)[1]);
              int color = new BigInteger(((String[]) value)[0], 16)
                   .intValue();
              renderer.setBackground(new Color(color));
              renderer.setForeground(new Color(0xFFFFFFFF ^ color));
              return renderer;
             }
         });
         final JLabel demoLabel = new JLabel(
              "Display this text in the selected color", JLabel.CENTER);
         list.addListSelectionListener(new ListSelectionListener() {
    
             @Override
             public void valueChanged(ListSelectionEvent e) {
              String[] selected = (String[]) list.getSelectedValue();
              demoLabel.setForeground(new Color(new BigInteger(selected[0],
                   16).intValue()));
             }
         });
    
         JFrame frame = new JFrame("ColorList");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.add(new JScrollPane(list), BorderLayout.LINE_START);
         frame.add(demoLabel, BorderLayout.CENTER);
         frame.pack();
         frame.setLocationRelativeTo(null);
         frame.setVisible(true);
        }
    
        private String[][] getArray() {
         return new String[][] {
    
         { "000000", "Black" },
    
         { "000080", "Navy Blue" },
    
         { "0000C8", "Dark Blue" },
    
         { "0000FF", "Blue" },
    
         { "000741", "Stratos" },
    
         { "00FF00", "Green" },
    
         { "FF0000", "Red" },
    
         { "FFFFF0", "Ivory" },
    
         { "FFFFFF", "White" }
    
         };
    
        }
    
    }
    

    Piet

  • Determine the maximum value and the minimum value for each value in the 2D array

    Hello, I need help please. Sorry my English is not very good. I have table 2D in which each value describes a waveform, I needed a time interval to determine the minimum and maximum value of each element of the array.


  • Separate colors for each Spry tab?

    Is it possible to have distinct colors for each tab in the Panel tabs Spry? I think it would be a style < <. "TabbedPanelsTab > >, but how can you identify each of the individual tabs - through < < tabindex ="? ' > >?

    Thank you.

    Just add a new class for each spry tab...

    • Tab 1
    • Tab 2
    • Tab 3
    • Tab 4

    CSS:

    li.blue { background-color: blue }
    li.red { background-color: red }
    li.yellow { background-color: yellow }
    li.green { background-color: green }
    

    Yay. colours Disco

  • Requirement of Beeping - how to get subtotals for each combination of 2 columns val

    Hi gurus, Experts and all,.

    Help me please with my reporting requirement, on how to code this in PIF. Thank you.

    Requirement: I need to get the subtotals for each value of the combination of two columns.

    Columns example: team group AMOUNT

    Sample column values: placed Team1 100
    Group b... Team2... 200

    GroupA - Team1 Subtotals = 500 (value of the sample only)
    GroupA - Team2 Subtotals = 400 (value of the sample only)
    Group b - Team1 Subtotals = 600 (value of the sample only)
    Group b - Team2 Subtotals = 200 (value of the sample only)

    GrandTotal = 1700

    Thank you.

    Jean Paul
    BEEP newbie

    Published by: user10955574 on October 28, 2010 05:40
    
     -  - 
    
    

    output for data

    GROUPA - TEAM1 - 200
    GROUPB - TEAM1 - 300
    GROUPC - TEAM2 - 400
    GROUPD - TEAM2 - 500
    GROUPA - TEAM3 - 600
    GROUPB - TEAM3 - 700
    GROUPC - TEAM4 - 800
    GROUPD - TEAM4 - 900
    GROUPA - TEAM5 - 1000
    
  • Type a table defined clusters to hold configuration data - definition of default values for each element of the array

    Hello

    I was wondering if I could get some information and opinions on the use of an array of type defined clusters to store configuration data.  I am creating a program to test several EHR and wanted to have a control of type defined for each HAD with the information needed to create the DAQmx tasks for all signals for it must HAVE.  I am eager to do so that the data are encoded in hard and not in a file that the user might spoil.

    Controls of type def are then put into a Subvi who chooses as appropriate, one based on the enumeration of Type DUT connected to a case structure.

    I have problems with the control of the defined type.  I see issues when you try to save a configuration unique to each element of the array in the array of clusters.  Somehow, it worked at first, but now by clicking on "Operations on the data--> default font of the current value ' on individual elements of the cluster or the entire cluster (array element) does not save data when I re - open the command def.  What I am doing wrong?  I'm trying to do something with the berries of the clusters that I shouldn't do?

    I enclose one of the defined reference type controls.  I tried to change it bare to see if that helped, but no luck.

    To reproduce, change the resource string for the element 0 of the array and do the new value by default.  Then close the def of type, and then reopen it.  The old value is always present in this element.  The VI is saved in LabVIEW 2012.

    The values of a typedef are not proprigated to the instances of the control. They get if created WHEN data values have changed. They will be not updated with the changes to come. You must create a VI specifically to hardcode your values or to implement a file based initialization. The base file would be much better and more flexible. If you don't want users to change the data simply encryption. There is a wedding blowfish library that you can download.

  • Is it possible to draw the same color for each curve automatically

    Hello

    Is it possible to draw the same color for each curve automatically. I use graphic XY basis with data set.

    Lol you'll either need to set the properties through the dialog box.  Or use the nodes property of the graph to adjust the Active plot and then set the color of the plot.  This can be done in a loop For.

  • How to change the highlight color for windows 7 (select the file or folder)?

    How to change the highlight color for windows 7 in the aero theme (select the file or folder)?

    You can change the font size because it is not a widget.   To do this:

    1 type dpi in your Start menu search box, and then choose make text and other more or less important.
    2 - Choose a size you prefer
    3 - Click on apply.
  • Select the last value for each day of the table

    Hello!

    I have a table that contains several measures for each day. I need two queries on this table, and I'm not sure how to write them.

    The table stores the rows (sample data)
    *DateCol1                 Value       Database*
    27.09.2009 12:00:00       100           DB1
    27.09.2009 20:00:00       150           DB1
    27.09.2009 12:00:00       1000          DB2
    27.09.2009 20:00:00       1100          DB2
    28.09.2009 12:00:00       200           DB1
    28.09.2009 20:00:00       220           DB1
    28.09.2009 12:00:00       1500          DB2
    28.09.2009 20:00:00       2000          DB2
    Explanation of the data in the sample table:
    We measure the size of the data files belonging to each database to one or more times a day. The value column indicates the size of the files of database for each database at some point (date in DateCol1 European model).


    What I need:
    Query 1:
    The query must return to the last action for each day and the database. Like this:
    *DateCol1       Value      Database*
    27.09.2009        150          DB1
    27.09.2009       1100          DB2
    28.09.2009        220          DB1
    28.09.2009       2000          DB2
    Query 2:
    The query should return the average measurement for each day and the database. Like this:
    *DateCol1       Value      Database*
    27.09.2009       125          DB1
    27.09.2009      1050          DB2
    28.09.2009       210          DB1
    28.09.2009      1750          DB2
    Could someone please help me to write these two queries?

    Please let me know if you need further information.

    Published by: user7066552 on September 29, 2009 10:17

    Published by: user7066552 on September 29, 2009 10:17

    Why two queries when it suffice ;)

    SQL> select dt
      2       , db
      3       , val
      4       , avg_val
      5    from (
      6  select dt
      7       , val
      8       , db
      9       , row_number () over (partition by db, trunc (dt)
     10                                 order by dt desc
     11                            ) rn
     12       , avg (val) over (partition by db, trunc (dt)) avg_val
     13    from test)
     14   where rn = 1
     15  order by dt
     16  /
    
    DT        DB           VAL    AVG_VAL
    --------- ----- ---------- ----------
    27-SEP-09 DB2         1100       1050
    27-SEP-09 DB1          150        125
    28-SEP-09 DB2         2000       1750
    28-SEP-09 DB1          220        210
    
  • (For each) components in the OSB

    I try to use component "For-Each" to perform a loop on the message to bulk out bulk and publish individual messages of the loop. However the loop does not run several times. It passes through the only once for each component. The key message is ';' separated from text messages.

    There are about 4-5 different parameters to be set for the component. as a County, index, param, and xpath.
    What best values to put in it so that the component gives the desired effect?


    Thanks in advance.

    You try to say I'm going to use a component of the NEWSPAPER inside the component for EACH?

    N ° it is a control sample if the loop is getting executed as required. You can completely ignore the alert/Log and place your logic. With sample data that you have posted, I have confirmation code posted earlier worked on my local machine. You may need to change depending on your use case.

    But with my specified parameters for EACH component is not executed at least once.

    The first glance, it seems that you XPath: v_XML. BUlkMessage.Transaction (v_XML here are the above XML code) has something to do with your problem. You should return table of elements that confirm specific condition. With the help of .//transaction is a way to query all the with in the specific variable.

    Thank you
    Maury

  • How can I make a cell formula will apply for the entire column? For example D2 appears B2 - C2. How can I copy this formula for each cell in the column?

    How can I make a cell formula will apply for the entire column? For example D2 appears B2 - C2. How can I copy this formula for each cell in the column?

    If you want the formula is the same (B2 - C2) in the cell of each column you must change it as ($B$ - 2$ C$ 2). Then copy it, select the whole column and paste.

  • call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. The other rows are based on the entities

    Hi Experts,

    JDeveloper 12.1.3.0.0

    I have a VO based on entity object. With a column of the VO is transient attribute (I created).

    I need to call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. As well as other attributes.

    So can anyone suggest how can I achieve this?

    Thank you

    AR

    I think that you need a stored function (which returns the value) in this case, is not?

    Take a look at:

    https://docs.Oracle.com/CD/B31017_01/Web.1013/b25947/bcadvgen005.htm

    and search for:

    Invoking stored function with only Arguments in

    call your function in the Get attribute and return value accessor...

  • SQL query to retrieve a single record for each employee of the following table?

    Hi all

    Help me on the writing of SQL query to retrieve a single record for each employee of the following table? preferably a standard SQL.

    CREATE TABLE xxc_contact)

    empnum NUMBER,

    alternatecontact VARCHAR2 (100),

    relationship VARCHAR2 (10),

    phtype VARCHAR2 (10),

    Phone NUMBER

    );

    insert into xxc_contact values (123456, 'Rick Grimes', 'SP', 'Cell', 9999999999)

    insert into xxc_contact values (123456, 'Rick Grimes', 'SP', 'Work', 8888888888)

    insert into xxc_contact values (123457, 'Daryl Dixon', 'EN', 'Work', 7777777777)

    insert into xxc_contact values (123457, 'Daryl Dixon', 'EN', 'Home', 3333333333)

    insert into xxc_contact values (123456, 'Maggie Greene', 'CH', 'Cell', 9999999999)

    insert into xxc_contact values (123456, 'Maggie Greene', 'CH', 'Home', 9999999999)

    expected result:

    EmpNum AlternateContact Relationship PhType Phone       

    123456 rick Grimes SP cell 9999999999

    Daryl Dixon EN work 7777777777 123457

    Home 123458 Maggie Greene CH 6666666666

    Thanks in advance.

    994122 wrote:

    Thank you all, that I got a result

    http://www.orafaq.com/Forum/m/620305/#msg_620305

    By Lalit Kumar B...

    Specifically, the two simple solutions provided were:

    1 using the row_number, entitled Oracle ranking based on descending order of the inside telephone each empnum group. And finally selects the lines which has least rank (of least since that order is descending for phone).

    SQL > column alternatecontact format A20;

    SQL >

    SQL > SELECT empnum, alternatecontact, relationship, phtype, phone

    2 from (SELECT a.*, row_number() over r (PARTITION BY empnum ORDER BY phone / / DESC))

    3 FROM xxc_contact one)

    4. WHEN r = 1

    /

    EMPNUM ALTERNATECONTACT RELATIONSHIP PHTYPE PHONE

    ---------- -------------------- ---------- ---------- ----------

    123456 rick Grimes SP cell 9999999999

    Daryl Dixon EN work 7777777777 123457

    Home 123458 Maggie Greene CH 6666666666

    2. with the help of MAX, Oracle automatically assigns the maximum phone for all the rows in each group of empnum. And finally selects the rows with the maximum phone. Order by clause is omitted here intentionally. You can find out why.

    SQL > SELECT empnum, alternatecontact, relationship, phtype, phone

    2 (SELECT a.*, MAX (phone) over (PARTITION BY empnum) rn FROM xxc_contact one)

    3 WHERE phone = rn

    4.

    EMPNUM ALTERNATECONTACT RELATIONSHIP PHTYPE PHONE

    ---------- -------------------- ---------- ---------- ----------

    123456 rick Grimes SP cell 9999999999

    Daryl Dixon EN work 7777777777 123457

    Home 123458 Maggie Greene CH 6666666666

    Kind regards

    Lalit

  • Unlock the position of the 'legends box' for each image in the slideshow

    Hi guys,.

    I have a slideshow that has 8 images with thumbnails for example. I want to move the caption (text box) for each image in the other location, but if I adjust the caption of an image and others, their legends are exactly in the same position as the caption for the first image.

    There must be a work around for this surely,

    I came across this post - help with captions in slide shows , but I do not understand what is needed to do this, if someone manages to do, could you please limit exactly what is needed to get the look. I tried to disable "change set" and that did not help either.

    I hope someone can help here, I really need to be located in different places for each image captions in the slide show.

    Thank you!

    You can use any composition in the form of a slide show and add the text block in the container, place the block of text in a different location for each container.

    Thank you

    Sanjit

Maybe you are looking for

  • I get an error message that "a copy of Firefox is already open. Only one copy of Firefox can be open at a time"and I have no open copy.

    I get an error message that "a copy of Firefox is already open. Only one copy of Firefox can be open at a time"and I have no open copy. How can I fix this problem? I like firefox because it runs many technical programs on the web that do not work wit

  • How and where I can get firefox 21

    Okay I really get irritated. all I ask is how and where I can get firefox 21. I asked this question a million times, and each answer which I am grateful that they took the time to answer but they all avoid answering my question. It's a simple questio

  • Fan almost constantly on my Equium A210-17I

    Hello I've had my laptop for a good few weeks now, and, apart from the occasional black screen, I'm very happy with it. Today, however, I noticed that the fan is almost constantly on when I don't know that it didn't need to be. Despite the laptop bei

  • Software DVD Factory R60

    I have a R60 with a simultaneous display and HARD drive failure. I have replaced both, installed XP and can not read the DVD. How can I retrieve the DVD software that came on my R60 from the factory?

  • Cannot place the Volume icon in the taskbar

    My desktop (Windows XP Home Edition, SP3) PC has problems with sound: The "Sound and Audio Devices Properties" window has 2 options in the box "Device volume" (in the middle): (1) 'Mute'. It works OK - I can check this option and sound is cut off, as