Change Color on Sheet Tab's from value in Cell

I have try this code but it seem's not to Work propperly
Private Sub Worksheet_Change(ByVal Target As Range)
'    If Range("F58") > 9 Then
'         Me.Tab.ColorIndex = 3
'    ElseIf Range("F58") = 8 Then
'         Me.Tab.ColorIndex = 8
'    ElseIf Range("F58") < 7 Then
'        Me.Tab.ColorIndex = 10
'    ElseIf Range("F58:F59") = 0 Then
'        Me.Tab.ColorIndex = xlColorIndexNone
'     Else
'         Me.Tab.ColorIndex = xlNone
'    End If
'End Sub
the options ill need is
1 When cell F58 is over 8 then Tab change to GOLD color
2 When Cell F58 (8) then Tab Change to Silver color
3 when cell F58 is under 8 Then Tab Change to Bronze Color
If no Number in F58 Then No Color

Thanks to you for the Help i have made a litle Change into it and then it's WORK as it shoul
your code.
Private Sub Worksheet_Change(ByVal Target As Range)
     If Range("F58") > 8 Then
          Me.Tab.ColorIndex = 10
     ElseIf Range("F58") = 8 Then
          Me.Tab.ColorIndex = 8
     ElseIf Range("F58") < 8 And Range("F58") > 0 Then
         Me.Tab.ColorIndex = 3
     ElseIf Range("F58") = 0 And Range("F59") = 0 Then
         Me.Tab.ColorIndex = xlColorIndexNone
     End If
 End Sub
My ode after the changes
Private Sub Worksheet_Change(ByVal Target As Range)
          If Range("F58") > 8 Then
          Me.Tab.ColorIndex = 10
         ElseIf Range("F58") = 8 Then
          Me.Tab.ColorIndex = 8
         ElseIf Range("F58") < 8 And Range("F59") > 8 Then
         Me.Tab.ColorIndex = 3
     ElseIf Range("F58") = 0 And Range("F59") = 0 Then
         Me.Tab.ColorIndex = xlColorIndexNone
     End If
 End Sub
Your Regards From Henrik-1 And Danish Dart Union

Similar Messages

  • How to change colors of LCD/VFD controls from SGC-Tek?

    Hi Anybody got idea how to change colors of LCD/VFD controls from SGC-Tek?
    I have tried but could not. When I try to make myself a nest cluster of clusters of LEDs, I can change colours but I can't do the same thing with LCD/VFD controls.
    Please check at LCD/VFD controls
    Clement

    I suspect this repsonse is somewhat mis-leading, the code has no effect on the control other than setting its state, although the route is somewhat tedious for the mod.
    I would imagine that the control is set up so that the pixels didn't move around when they are being used as controls.
    There are nested groups and locks on the controls, which might make the ordering in the cluster easier to manage.
    The following should work....... ;-) it did for me
    Open  your own new VI
    Open the main LCD VI
    Open the Browse VI Hierachy
    Drag and drop the LCD VI onto your own diagram
    Create a cluster from the LCD VI's connector
    Now ungroup the clusters and unlock them (this is tedious) if you create your own then you could be more imaginative in the structure, I leave that for homework.
    Then import a new bitmap (gif) into the control
    Now update the modified contol back into the master control
    ........ Told you it could be done, but I am not sure the pain was worth it.
    BUT
    Try the alternative control..... with colour settings as well, ANY colour and even some size control.
    It was here http://members.lycos.co.uk/sgctek/

  • Change Color of Disable Tab in JTabbedPane

    Hello Friends,
    I have one JTabbedPane in my Application.
    In that one Tab is Disable.
    I want to change default Background and Foreground color of that tab.
    Can u help me...
    Thanks in Advance,
    Nishith Shah.

    hii,
    please I can't find out any DisableColor or something similair for defaultTabbedPaneUI, please try (unselect)
    package jtabs;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Insets;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import javax.swing.plaf.ColorUIResource;
    public class TestTabbedPane extends JFrame {
        JTabbedPane tabbedPane;
        public TestTabbedPane() {
            tabbedPane = new JTabbedPane();
            tabbedPane.setPreferredSize(new Dimension(300, 200));
            getContentPane().add(tabbedPane);
            JPanel panel = new JPanel();
            tabbedPane.add(panel, "null");
            JTextField one = new JTextField("one");
            tabbedPane.add(one, "one");
            JTextField two = new JTextField("two");
            tabbedPane.add(two, "two");
            tabbedPane.setEnabledAt(2, false);
            /*UIManager.put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0));
            UIManager.put("TabbedPane.highlight", new Color(255, 0, 0));
            UIManager.put("TabbedPane.lightHighlight", new Color(0, 255, 0));
            UIManager.put("TabbedPane.darkShadow", new Color(0, 255, 0));
            UIManager.put("TabbedPane.shadow",new Color(0, 0, 255));
            UIManager.put("TabbedPane.light" ,  new Color(0, 255, 0));
            UIManager.put("TabbedPane.foreground", new Color(0, 0, 0));
            UIManager.put("JTabbedPane.font", new Font("Dialog", Font.ITALIC, 12));
            UIManager.put("TabbedPane.selected", new Color(255, 0, 0));
            UIManager.put("disable", new Color(255, 0, 0));
            UIManager.put("TabbedPane.selectHighlight" , new Color(0, 0, 0));*/
            //UIManager.put("TabbedPane.background",  new Color(0, 0, 0));
            //SwingUtilities.updateComponentTreeUI(tabbedPane);
            /*tabbedPane.setTitleAt(2, "<html><font color=" +
                    (tabbedPane.isEnabledAt(2) ? "black" : "red") + ">" +
                    tabbedPane.getTitleAt(2) + "</font></html>");*/
        public static void main(String args[]) {
            TestTabbedPane frame = new TestTabbedPane();
            frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
            frame.pack();
            frame.setVisible(true);
    } value are from
    import javax.swing.*;
    import java.util.*;
    public class GetUIManagerList {
        public static void main(String[] args) {
            UIDefaults defaults = UIManager.getDefaults();
            System.out.println(defaults.size() + " properties defined !");
            System.out.println("-----------------------------------");
            String[] colName = {"Key", "Value"};
            String[][] rowData = new String[defaults.size()][2];
            int i = 0;
            for (Enumeration e = defaults.keys(); e.hasMoreElements(); i++) {
                Object key = e.nextElement();
                rowData[ 0] = key.toString();
    rowData[i][ 1] = "" + defaults.get(key);
    System.out.println(rowData[i][0] + " ,, " + rowData[i][1]);
    please could I ask camickr or DarrylBurke how to overide disabled label in JTabbedPane (without Shadows), with using their SwingUtils
    ... kopik                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Change color of portal tab strip

    Hi.
    In EP versión nw04s sp 16 there is a bug in the theme editor, is not posible to modify the tab color in the standard portal tabstrip.
    The note 1150293 said that it should modify some css files, i do it but the tabs of standard tabstrip control do not change color...
    I have clear the portal cacher, open a new browser window, restart java server...
    any idea?
    thanks...

    Thanks Aditya... but i made the modifications in this manner... i have copied the css files in other directory, edit it, and, then, i put it manually in the corresponding directory...
    When, after that, i open the css files, it has the modifications than i made... but the standar tabstrip control remains with the same colors.
    Any other idea?
    Thank you very much and regards

  • Change color/font of tabs

    Is there a way to change the color or font of tabs, in Forms 6i, based on certain data in that data block.
    For example, I have a form with 8 tabs and 8 data blocks. Not all tabs have data. For the ones that have data I want to make a color (lets say blue) and the ones that have discipline I want to make that tab a different color (red for example).
    Is there a way to do this? I looked at set_tab_page_property, but did not see anything about color of the tab. I was able to set the enabled/disabled successfully, but in this case this will not help me.
    Thanks in advance.
    Sandeep.

    You can't change the font or color of a tab-page-"header". You can only change the text (maybe put the number of records in brackets behind the text)

  • Changing colors/style sheets with custom header portlets?

    We would like write a completely custom header portlet (a standard portlet that is designated as a header, notusing the branding server), but I can't seem to find a way to change the style sheets in subportals when I do this.
    Am I missing something? Do you have to use the branding engine to control style sheets in subportals, or is there another way?
    Chris StoffelPortal DeveloperHalliburton KBR

    ------- developersupport wrote on 12/11/03 4:24 PM -------
    The way Branding accomplishes what you're looking for is by setting a portlet setting called &#034;Portal-Style&#034; on the header portlet using the EDK.  This setting can be set either as an Admin level or CommunityPortlet level setting.  When the portal loads a page with a header, it will check to see if the header has this preference set (first on the CommunityPortlet level, if the header is on a community, and then on the Admin level).  If so, the portal will cause everything to use the stylesheet specified in the setting value.
    The setting value is the name of the stylesheet.  For example, if you wished every page displaying the header to be orange, you could set the &#034;Portal-Style&#034; Admin setting on the portlet to a value of &#034;mainstyle17&#034;, the orange-themed stylesheet.
    Perhaps I'm not setting the preference properly. Sniffing the HTTP headers between the gadget and portal servers, I do see:
    [HTTP_CSP_GLOBAL_GADGET_PREF] => Portal-Style=mainstyle17
    (I also tried it with Portal%u002DStyle, but neither works)
    The remote server header portlet doesn't seem to be picking up the fact that there is an admin pref to override the main page's stylesheet. Did I create the portlet wrong, or am I setting the preference incorrectly, or what? Thanks

  • Changing Colors of selected tab in JTabbedPane.

    Do someone has some code that can show how to
    change the color of the selected tab with JTabbedPane.
    I can change the other tabs colors with setBackground and setForeground, setBackgroundAt........ but it is the selected
    tab that will not change from the default grey color.
    thanks

    try this code, it works.
    public class TabBackgroundChange extends JFrame {
    private JTabbedPane tabPane = null;
    public static final Color selTabColor = Color.red;
    Color nonSelectedTabColor = null;
    public TabBackgroundChange() {
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception ex) {
    ex.printStackTrace();
    tabPane = new JTabbedPane();
    tabPane.add("One", new JPanel());
    tabPane.add("Two", new JPanel());
    tabPane.add("Three", new JPanel());
    this.getContentPane().add(tabPane);
    this.setSize(200, 200);
    this.setVisible(true);
    tabPane.addChangeListener(new TabChangeListener());
    tabPane.setSelectedIndex(1);
    tabPane.setSelectedIndex(0);
    public static void main(String[] args) {
    TabBackgroundChange tabBackgroundChange1 = new TabBackgroundChange();
    private class TabChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent ce) {
    int iSelTab = tabPane.getSelectedIndex();
    Color unSelectedBackground = tabPane.getBackgroundAt(iSelTab);
    for(int i=0; i<tabPane.getTabCount(); i++) {
    tabPane.setBackgroundAt(i, unSelectedBackground);
    tabPane.setBackgroundAt(iSelTab, Color.red);
    }

  • Changing Color of MS Office 2013 - From Grey to White

    How do I make MS Office - Excel, Word and Outlook on normal white color just a MS 2007.. Please help.
    I tried changing it to white from account menu..but it still is the same. 

    So when you go to Accounts (or Office Account in Outlook) and change it from one of the two Gray options to White, nothing happens?
    Screenshots of the 3 color choices are here -
    http://www.slipstick.com/outlook/2013/changing-office-2013s-color-scheme/ - there aren't colors like in Office 2007.
    Diane Poremsky [MVP - Outlook]
    Outlook & Exchange Solutions Center
    Outlook Tips
    Subscribe to Exchange Messaging Outlook weekly newsletter

  • I have a 5th generation IPod touch, and today when i turned it on everything was fine. Then suddenly the screen froze and changed colors and lines started coming from the sides of the Ipod until the reached the middle. Now it won't turn back on.

    I tried restarting it by using just the power on button at first. Once that failed I held the power and home buttom for ten sconds and that didn't work. I then plugged in the ipod to see if it needed charged, and repeated the same two steps at before but to no avail. Finally, I opened up itunes and plugged my ipod in, but nothing came up. I then tried to turn it on for a third time, but nothing happened. I just confused on what happened. Could it be a bad display, or did the whole thing just die on me? Help please.  

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • How to change color of text is value is equal to 0

    how to change color of text or background if value is equal to 0

    HI,
    In Template Builder,Insert the conditional region,there you select the column and give condition is equal to 0 and in advanced enter the following code
    <?if:XMLfield=0?><xsl:attribute xdofo:ctx="block" name="background-color">red</xsl:attribute><?end if?>
    try this it works.
    Regards
    Uday

  • Apple Menu Logo Changes Colors

    I've been trying to figure out why the Apple Logo on he menu bar changes color, seemingly at random, starting from the dark gray of graphite theme, then cycling through reds, oranges, yellows, etc--sometimes multicolored.
    I've never played around with "skins" or tried to alter appearance in any other way.
    Anyone Have similar experience / explanation?
    Corrupt Files?

    Hi,
    It'd be cool to have that happen on my menu bar.
    IF, this is a serious system issue than you would hope that you don't have it to.
    Dimaxum

  • Change Excel sheet tab color using Open XML dll

    Hi,
    I want to change the sheet tab color of an excel Xlsx  document. I am using the following code but it does not set the sheet color. I get object reference exception when I set the sheet tab color.
    public static string filepath = @"C:\Test\Book1.xlsx";
    private static void ChangeSheetcolor()
    try
    using (SpreadsheetDocument spreadSheetDocument = SpreadsheetDocument.Open(filepath, false))
    WorkbookPart workbookPart = spreadSheetDocument.WorkbookPart;
    IEnumerable<Sheet> sheets = spreadSheetDocument.WorkbookPart.Workbook.GetFirstChild<Sheets>().Elements<Sheet>();
    //my code
    WorksheetPart worksheetPart =
    GetWorksheetPartByName(spreadSheetDocument, "Sheet1");
    if (worksheetPart != null)
    // worksheetPart.Worksheet.SheetProperties.TabColor.Rgb = DocumentFormat.OpenXml.HexBinaryValue.FromString("Red");
    worksheetPart.Worksheet.SheetProperties.TabColor.Rgb = DocumentFormat.OpenXml.HexBinaryValue.FromString("#CCCCCC");
    // Save the worksheet.
    worksheetPart.Worksheet.Save();
    catch (Exception ex)
    private static WorksheetPart
    GetWorksheetPartByName(SpreadsheetDocument document,
    string sheetName)
    IEnumerable<Sheet> sheets =
    document.WorkbookPart.Workbook.GetFirstChild<Sheets>().
    Elements<Sheet>().Where(s => s.Name == sheetName);
    if (sheets.Count() == 0)
    //does not exist
    return null;
    string relationshipId = sheets.First().Id.Value;
    WorksheetPart worksheetPart = (WorksheetPart)
    document.WorkbookPart.GetPartById(relationshipId);
    return worksheetPart;
    How to change the sheet tab color using Open XML dlls.
    Thanks
    Ashok

    Hi J_Prasanna,
    I'm afraid that it's not possible with OpenXML SDK, but it's possible if you use Excel PIA along with Internet Explorer. Use the Internet Explorer COM object to render the HTML content, then copy the document, use the Paste method of the Worksheet object
    to paste the text with format.
    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.Application")
    With IE
    .Visible = False
    .Navigate "about:blank"
    .document.body.InnerHTML = Sheets("Sheet1").Range("A1").Value
    .document.body.createtextrange.execCommand "Copy"
    ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("A1")
    .Quit
    End With
    The code is similar if you use managed project.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to change the background color of  a Tab Canvas

    Hi All,
    I accidentally changed existing background color of a tab Canvas to ' gray' which is not matching with main canvas (which has default).
    How can I change background color to default. Please help me.
    -Thanks

    In the property palette of the tab page, click on the "Background Color" property and click the "Inherit" button on the top of the property palette, this will revert the value of the property to the default when the tab page was created which is <Unspecified>.
    But if your tab page has inherited the color from a property class it will revert to what was specified in the property class.
    Tony

  • How to change color of selected label from list of labels?

    My Problem is that I have a list of labels. RowHeaderRenderer is a row header renderer for Jtable which is rendering list items and (labels).getListTableHeader() is a method to get the list. When we click on the label this code is executed:
    getListTableHeader().addMouseListener(new MouseAdapter()
    public void mouseReleased(MouseEvent e)
    if (e.getClickCount() >= 1)
    int index = getListTableHeader().locationToIndex(e.getPoint());
    try
    if (((ae_AlertEventInfo)theAlerts.values().toArray()[index]).ackRequiredFlag)
    AcknowledgeEvent ackEvent = new AcknowledgeEvent(
    this, (ae_AlertEventInfo)theAlerts.values().toArray()[index]);
    fireAcknowledgeEvent(ackEvent);
    ((HeaderListModel)listModel).setElementAt(ACK, index);
    catch(Exception ex) {;}
    Upon mouse click color of the label should be changed. For some period of time ie. Upto completion of fireAcknowledgeEvent(ackEvent);
    This statement is calling this method:
    public void handleAcknowledgeEvent(final AcknowledgeEvent event)
    boolean ackOk = false;
    int seqId = ((ae_AlertEventInfo)event.getAlertInfo()).sequenceId;
    if (((ae_AlertEventInfo)event.getAlertInfo()).ackRequiredFlag)
    try
    // perform call to inform server about acknowledgement.
    ackOk = serviceAdapter.acknowledge(seqId,
    theLogicalPosition, theUserName);
    catch(AdapterException aex)
    Log.error(getClass(), "handleAcknowledgeEvent()",
    "Error while calling serviceAdapter.acknowledge()", aex);
    ExceptionHandler.handleException(aex);
    else
    // Acknowledge not required...
    ackOk = true;
    //theQueue.buttonAcknowledge.setEnabled(false);
    final AlertEventQueue myQueue = theQueue;
    if (ackOk)
    Object popupObj = null;
    synchronized (mutex)
    if( hasBeenDismissed ) { return; }
    // mark alert event as acknowledged (simply reset ack req flag)
    ae_AlertEventInfo info;
    Iterator i = theAlerts.values().iterator();
    while (i.hasNext())
    info = (ae_AlertEventInfo) i.next();
    if (info.sequenceId == seqId)
    // even if ack wasn't required, doesn't hurt to set it
    // to false again. But it is important to prevent the
    // audible from playing again.
    info.ackRequiredFlag = false;
    info.alreadyPlayed = true;
    // internally uses the vector index so
    // process the queue acknowledge update within
    // the synchronize block.
    final ae_AlertEventInfo myAlertEventInfo = event.getAlertInfo();
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    myQueue.acknowledge(myAlertEventInfo);
    myQueue.updateAcknowledgeButtonState();
    // here we should stop playing sound
    // if it is playing for this alert.
    int seqId1;
    if (theTonePlayer != null)
    seqId1 = theTonePlayer.getSequenceId();
    if (seqId1 == seqId)
    if (! theTonePlayer.isStopped())
    theTonePlayer.stopPlaying();
    theTonePlayer = null;
    // get reference to popup to be dismissed...
    // The dismiss must take place outside of
    // the mutex... otherwise threads potentially
    // hang (user hits "ok" and is waiting for the
    // mutex which is currently held by processing
    // for a "move to summary" transition message.
    // if the "dismiss" call in the transition
    // message were done within the mutex, it might
    // hang on the dispose method because the popup
    // is waiting for the mutex...
    // So call popup.dismiss() outside the mutex
    // in all cases.
    if(event.getSource() instanceof AlertEventPopup)
    popupObj = (AlertEventPopup)event.getSource();
    else
    popupObj = thePopups.get(event.getAlertInfo());
    thePopups.remove(event.getAlertInfo());
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    // search vector elements to determine icon color in main frame
    String color = getColor();
    fireUpdateEvent(new UpdateEvent(this, blinking, color));
    // Call dismiss outside of the mutex.
    if (popupObj !=null)
    if(popupObj instanceof AlertEventPopup)
    ((AlertEventPopup)popupObj).setModal(false);
    ((AlertEventPopup)popupObj).setVisible(false); // xyzzy
    ((AlertEventPopup)popupObj).dismiss();
    else
    // update feedback... ack failed
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    myQueue.setInformationMessage("Acknowledge failed to reach server... try again");
    return;
    Code for RowHeaderRenderer is:
    class RowHeaderRenderer extends JLabel implements ListCellRenderer
    JTable theTable = null;
    ImageIcon image = null;
    RowHeaderRenderer(JTable table)
    image = new ImageIcon(AlertEventQueue.class.getResource("images" + "/" + "alert.gif"));
    theTable = table;
    JTableHeader header = table.getTableHeader();
    setOpaque(true);
    setHorizontalAlignment(LEFT);
    setForeground(header.getForeground());
    setBackground(header.getBackground());
    setFont(header.getFont());
    public Component getListCellRendererComponent( JList list, Object value,
    int index, boolean isSelected, boolean cellHasFocus)
    int level = 0;
    try
    level = Integer.parseInt(value.toString());
    catch(Exception e)
    level = 0;
    if (((ae_AlertEventInfo)theAlerts.values().toArray()[index]).ackRequiredFlag)
    setBorder(UIManager.getBorder("TableHeader.cellBorder"));
    this.setHorizontalAlignment(JLabel.CENTER);
    this.setVerticalAlignment(JLabel.CENTER);
    setIcon(image);
    else
    setBorder(BorderFactory.createLineBorder(Color.gray));
    setText("");
    setIcon(null);
    return this;
    I tried but when i am clicking a particular label, the color of all labels in the List is being changed. So can you please assist me in changing color of only the label that is selected and the color must disappear after completion of Upto completion of fireAcknowledgeEvent(ackEvent);

    im a bit confused with the post so hopefully this will help you, if not then let me know.
    I think the problem is that in your renderer your saying
    setBackground(header.getBackground());which is setting the backgound of the renderer rather than the selected item, please see an example below, I created a very simple program where it adds JLabels to a list and the renderer changes the colour of the selected item, please note the isSelected boolean.
    Object "value" is the currentObject its rendering, obviously you may need to test if its a JLabel before casting it but for this example I kept it simple.
    populating the list
    public void populateList(){
            DefaultListModel model = new DefaultListModel();
            for (int i=0;i<10;i++){
                JLabel newLabel = new JLabel(String.valueOf(i));
                newLabel.setOpaque(true);
                model.addElement(newLabel);           
            this.jListExample.setModel(model);
            this.jListExample.setCellRenderer(new RowHeaderRenderer());
        }the renderer
    class RowHeaderRenderer extends JLabel implements ListCellRenderer
        JTable theTable = null;
        public Component getListCellRendererComponent(JList list, Object value,
                                                      int index, boolean isSelected, boolean cellHasFocus){
            JLabel aLabel = (JLabel)value;
            if (isSelected){
                aLabel.setBackground(Color.RED);
            }else{
                aLabel.setBackground(Color.GRAY);
            return aLabel;       
    }

  • How do I get a field to automatically select a value and change color based on another automatic field?

    Here is the situation:
    I have a row on a form called Finding Risk Rating. In this row are four fields: Probability, Severity, Risk Rating, Color.
    Probability is a drop down menu with the following values: 1, 2, 3, 4, 5
    Severity is a drop down menu with the following values: A, B, C, D, E
    Risk Rating is a field that I have a custom calculation script:
    var riskRating = this.getField("Probability").value+this.getField("Severity").value;
    event.value = riskRating;
    So, when I pick Probability = 1 and Severity = D, Risk Rating will automatically change to 1D, etc. This works fine on the surface as far as I can tell.
    The part where I am stuck, is the fourth field Color.
    Ideally, I want Color to be automatically populated depending on the value of Risk Rating. For example, for 1E I would want it to say "YELLOW" and the field to change color to yellow. For 1A it would be "GREEN" with the color green, etc.
    I tried doing an if else for all cases, but it never refreshes to the correct value. I then checked using app.alert to see what fields riskRating and colorRank are (see code below), and I noticed that riskRating never changes, even though the value in Risk Rating changes. Is there a way to order script(s) so that if I execute one, the other will follow? I'm new to scripting for forms and haven't done any programming in 10+ years, so feel free to rip my code in favor or something more efficient, or direct me to a good resource I can learn from.
    Here's the basis of what I have for scripting on Color. It's brief because I wanted to test it out before writing every 'if else' statement.
    var colorRank;
    var riskRating = this.getField("Risk Rating").value;
    if (riskRating = "1E") colorRank = "YELLOW";
    else if (riskRating = "1A") colorRank = "GREEN";
    else if (riskRating = "5A") colorRank = "RED";
    event.value = colorRank;
    app.alert("colorRank = " + colorRank + ", riskRating = " + riskRating);
    Any help is appreciated. Thanks!

    One problem is if more than one combo box item has the same number associated with it, you cannot simply set the export value to the corresponding number since they need to be unique (or the user interface behaves weird). One thing you can do is set up an object to associate a list item with a value, and look up the value in code when a list item is selected.
    For more information, see: http://acrobatusers.com/tutorials/2007/js_list_combo_livecycle

Maybe you are looking for

  • HT5538 can itunes have more than one apple id attached to it

    I am trying to not have iclouds and itunes sync the same content on different Ipads, yet all ipad connected to the same itunes.  Is that possible?

  • Message when I create  one item  in new portfolio

    Hello When i was creating a new item  in the portfolio  this message appears in the portal: An error occurred in the final release of locks at the end of the RPM transaction. Verify manually that the CGPL project locks created in the transaction have

  • Not able to open an older document in version 3.5

    Since i have upgraded numbers to version 3.5 i am not able to open an older numbers-document. I get the message to get a newer numbers-version. What´s wrong?

  • Upload of multiple rulesets

    Hello, I have created logical system and defined rules according to the no of risk. I need to know, a checklist of steps on how to upload multiple rulesets, with it's associated risks, for different logical systems (which have been assigned to them)?

  • 7D Mark II missing a simple feature from the 70D and Rebels

    Please add, by firmware update, the 3x digital zoom (1:1 pixels, really 2.875x) in video feature present in the 70D and many of the Rebel cameras. I can attest to its usefulness from my use of it in my T2i. It's useful for astrophotography, specifica