jdk/test/javax/swing/JTable/6937798/bug6937798.java
author duke
Wed, 05 Jul 2017 17:52:05 +0200
changeset 10620 9df40a1578ef
parent 6374 e214162c907e
child 31448 1066345d2a8a
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5588
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
     1
/*
6374
e214162c907e 6982137: Rebranding pass 2 - missed copyright changes
ohair
parents: 5588
diff changeset
     2
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
5588
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
     4
 *
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
     8
 *
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    13
 * accompanied this code).
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    14
 *
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    18
 *
6374
e214162c907e 6982137: Rebranding pass 2 - missed copyright changes
ohair
parents: 5588
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e214162c907e 6982137: Rebranding pass 2 - missed copyright changes
ohair
parents: 5588
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e214162c907e 6982137: Rebranding pass 2 - missed copyright changes
ohair
parents: 5588
diff changeset
    21
 * questions.
5588
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    22
 */
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    23
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    24
/* @test
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    25
   @bug 6937798
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    26
   @summary Nimbus: Issues with JTable grid
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    27
   @author Alexander Potochkin
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    28
   @run main bug6937798
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    29
*/
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    30
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    31
import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    32
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    33
import javax.swing.*;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    34
import javax.swing.table.AbstractTableModel;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    35
import javax.swing.table.TableModel;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    36
import java.awt.*;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    37
import java.awt.image.BufferedImage;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    38
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    39
public class bug6937798 {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    40
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    41
    public static void main(String... args) throws Exception {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    42
        UIManager.setLookAndFeel(new NimbusLookAndFeel());
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    43
        SwingUtilities.invokeAndWait(new Runnable() {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    44
            public void run() {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    45
                new bug6937798();
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    46
            }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    47
        });
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    48
    }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    49
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    50
    public bug6937798() {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    51
        final JTable table = createCountryTable();
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    52
        table.setShowGrid(true);
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    53
        table.setSize(100, 100);
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    54
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    55
        BufferedImage im = new BufferedImage(table.getWidth(), table.getHeight(), BufferedImage.TYPE_INT_ARGB);
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    56
        Graphics g = im.getGraphics();
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    57
        table.print(g);
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    58
        g.dispose();
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    59
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    60
        for (int i = 0; i < im.getHeight(); i++) {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    61
            for (int j = 0; j < im.getWidth(); j++) {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    62
                if (im.getRGB(i, j) == table.getGridColor().getRGB()) {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    63
                    System.out.println("got it!");
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    64
                    return;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    65
                }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    66
            }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    67
        }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    68
        throw new RuntimeException("no table's grid detected....");
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    69
    }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    70
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    71
    protected JTable createCountryTable() {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    72
        // Column headers
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    73
        final String
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    74
                [] headers = {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    75
                "Name", "Capital City", "Language(s)", "Monetary Unit(s)", "EC Member"
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    76
        };
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    77
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    78
        // Table data
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    79
        final Object[][] data = {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    80
                {"Albania", "Tirane", "Albanian, Greek", "Lek", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    81
                {"Andorra", "Andorra la Vella", "Catalan, French, Spanish", "French Franc, Spanish Peseta", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    82
                {"Austria", "Vienna", "German, Slovenian, Croatian", "Schilling", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    83
                {"Belarus", "Minsk", "Byelorussian, Russian", "Belarusian Rubel", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    84
                {"Belgium", "Brussels", "French, Flemish, German", "Belgian Franc", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    85
                {"Bosnia & Herzegovina", "Sarajevo", "Serbo-Croatian", "Dinar", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    86
                {"Bulgaria", "Sofia", "Bulgarian, Turkish", "Lev", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    87
                {"Croatia", "Zagreb", "Serbo-Croatian", "Croatian Kuna", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    88
                {"Czech Republic", "Prague", "Czech, Slovak", "Koruna", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    89
                {"Denmark", "Copenhagen", "Danish", "Krone", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    90
                {"Estonia", "Tallinn", "Estonian, Latvian, Lithuanian, Russian", "Estonian Kroon", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    91
                {"Finland", "Helsinki", "Finnish, Swedish, Lappish", "Markka", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    92
                {"France", "Paris", "French", "Franc", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    93
                {"Germany", "Berlin", "German", "Deutsche Mark", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    94
                {"Greece", "Athens", "Greek, English, French", "Drachma", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    95
                {"Hungary", "Budapest", "Hungarian", "Forint", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    96
                {"Iceland", "Reykjavik", "Icelandic", "Icelandic Krona", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    97
                {"Ireland", "Dublin", "Irish, English", "Pound", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    98
                {"Italy", "Rome", "Italian", "Lira", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
    99
                {"Latvia", "Riga", "Lettish, Lithuanian, Russian", "Lat", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   100
                {"Liechtenstein", "Vaduz", "German", "Swiss Franc", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   101
                {"Lithuania", "Vilnius", "Lithuanian, Polish, Russian", "Lita", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   102
                {"Luxembourg", "Luxembourg", "French, German, Letzeburgesch", "Luxembourg Franc", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   103
                {"Macedonia", "Skopje", "Macedonian, Albanian, Turkish, Serbo-Croatian", "Denar", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   104
                {"Malta", "Valletta", "Maltese, English", "Maltese Lira", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   105
                {"Moldova", "Chisinau", "Moldovan, Russian", "Leu", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   106
                {"Monaco", "Monaco", "French, English, Italian", "French Franc", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   107
                {"the Netherlands", "Amsterdam", "Dutch", "Guilder", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   108
                {"Norway", "Oslo", "Norwegian", "Krone", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   109
                {"Poland", "Warsaw", "Polish", "Zloty", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   110
                {"Portugal", "Lisbon", "Portuguese", "Escudo", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   111
                {"Romania", "Bucharest", "Romanian", "Leu", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   112
                {"Russia", "Moscow", "Russian", "Ruble", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   113
                {"San Marino", "San Marino", "Italian", "Italian Lira", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   114
                {"Slovakia", "Bratislava", "Slovak, Hungarian", "Koruna", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   115
                {"Slovenia", "Ljubljana", "Slovenian, Serbo-Croatian", "Tolar", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   116
                {"Spain", "Madrid", "Spanish", "Peseta", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   117
                {"Sweden", "Stockholm", "Swedish", "Krona", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   118
                {"Switzerland", "Bern", "German, French, Italian", "Swiss Franc", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   119
                {"Turkey", "Ankara", "Turkish", "Turkish Lira", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   120
                {"Ukraine", "Kiev", "Ukranian, Russian, Romanian, Polish, Hungarian", "Hryvnia", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   121
                {"United Kingdom", "London", "English, Welsh", "British Pound", new Boolean(true)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   122
                {"Yugoslavia", "Belgrade", "Serbo-Croatian, Slovenian, Macedonian", "Dinar", new Boolean(false)},
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   123
        };
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   124
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   125
        // Table model
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   126
        TableModel dataModel = new AbstractTableModel() {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   127
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   128
            public int getColumnCount() {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   129
                return headers.length;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   130
            }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   131
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   132
            public int getRowCount() {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   133
                return data.length;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   134
            }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   135
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   136
            public Object getValueAt(int row, int col) {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   137
                return data[row][col];
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   138
            }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   139
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   140
            public String getColumnName(int column) {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   141
                return headers[column];
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   142
            }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   143
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   144
            public Class getColumnClass(int col) {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   145
                return getValueAt(0, col).getClass();
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   146
            }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   147
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   148
            public void setValueAt(Object aValue, int row, int column) {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   149
                data[row][column] = aValue;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   150
            }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   151
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   152
            public boolean isCellEditable(int row, int col) {
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   153
                return (col == 4);
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   154
            }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   155
        };
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   156
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   157
        // Create table with table model
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   158
        JTable countryTable = new JTable(dataModel);
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   159
        countryTable.setGridColor(Color.pink);
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   160
        countryTable.setBackground(Color.white);
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   161
        countryTable.setForeground(Color.black);
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   162
        return countryTable;
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   163
    }
57eca0aa621e 6937798: Nimbus: Issues with JTable grid
alexp
parents:
diff changeset
   164
}