Results 1 to 1 of 1
  1. #1
    dinu is offline Member
    Join Date
    Jan 2013
    Posts
    31
    Rep Power
    0

    Default Whats wrong with this row in jtable?

    y dosent this row get the color ??

    {Whats wrong with this row in jtable?-p1.jpg
    Java Code:
     table.setDefaultRenderer(Object.class, new DefaultTableCellRenderer()    
       {
          @Override
        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus, int row,
                int column) {
             Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus,row, column);
                 Boolean last=(Boolean)table.getValueAt(row, 3);
                 if(Boolean.TRUE.equals(last))
             	{
                c.setBackground(Color.green);
                table.repaint();
             } else {
                c.setBackground(Color.red);
                table.repaint();
             }
             return c;
            
          }
       });
    Last edited by dinu; 04-18-2013 at 08:35 AM.

Similar Threads

  1. whats wrong with my GUI?
    By EscSequenceAlpha in forum New To Java
    Replies: 12
    Last Post: 05-31-2012, 08:20 PM
  2. I cant do this.Whats wrong?
    By gaston7eze in forum Java 2D
    Replies: 5
    Last Post: 05-30-2012, 12:34 AM
  3. Whats wrong with this?
    By Alkor in forum AWT / Swing
    Replies: 7
    Last Post: 04-03-2012, 05:49 AM
  4. whats wrong
    By atenv in forum New To Java
    Replies: 6
    Last Post: 06-15-2010, 01:55 PM
  5. whats is wrong with this app??
    By mrajan in forum New To Java
    Replies: 4
    Last Post: 06-09-2010, 10:56 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •