google-code-export / macwidgets

Automatically exported from code.google.com/p/macwidgets
1 stars 0 forks source link

iTunesTable does not render alternating row-colors correctly #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using NetBeans 6.7, JDK6 on MacBook Air
2. Using Netbean's GUI-Builder, which has restricted code-access when creating 
Swing-
components

What is the expected output? What do you see instead?
When I used the createITunesTable-method with the mac widgets 0.9.4 everything 
was as 
expected. But with version 0.9.5, some table-columns do not show the 
alternating row-colors as 
expected.

IT LOOKS LIKE columns in the column-model that contain integer-data are not 
rendered 
correctly...

What version of the product are you using? On what operating system?
0.9.5 on Mac OS X 10.5.7, JDK6 (latest) with NetBeans 6.7 (latest)

Please provide any additional information below.
I have changed some of the automatically created code, using the 
custom-code-option from 
NetBeans for modifying GUI-Builder-code. Here's a code-snippet from what 
NetBeans 
automatically creates when using the GUI-Builder:

jTableLinks = MacWidgetFactory.createITunesTable(null);
...
        jTableLinks.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Eintrag", "Überschrift"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableLinks.setDragEnabled(true);
        jTableLinks.setName("jTableLinks"); // NOI18N
        jTableLinks.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jTableLinks.setShowVerticalLines(false);
        jTableLinks.getTableHeader().setReorderingAllowed(false);
        jScrollPane4.setViewportView(jTableLinks);

jTableLinks.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("
jTableLinks.
columnModel.title0")); // NOI18N

jTableLinks.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("
jTableLinks.
columnModel.title1")); // NOI18N

Original issue reported on code.google.com by m...@danielluedecke.de on 15 Jul 2009 at 11:48

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by kenneth....@gmail.com on 15 Jul 2009 at 1:37

GoogleCodeExporter commented 9 years ago
Can you see if the attached jar fixes your issue?

Original comment by kenneth....@gmail.com on 16 Jul 2009 at 6:36

Attachments:

GoogleCodeExporter commented 9 years ago
I guess it is the same file you sent me by e-mail, so I can confirm that this 
issue is fixed.

Original comment by m...@danielluedecke.de on 16 Jul 2009 at 7:55

GoogleCodeExporter commented 9 years ago
Right! I forgot this issue was attached to you (Daniel).

Thanks,
-Ken

Original comment by kenneth....@gmail.com on 16 Jul 2009 at 8:02

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Run the example code from the wiki.

What is the expected output? What do you see instead?

The example code below, taken from the wiki, gives me a table with a gray 
background
and no column headers, instead of one with headers and white/blue alternating 
row
colours. It does work with 0.9.4.

What version of the product are you using? On what operating system?

0.9.5, as well as the update from the 16 July comment on this issue. Both 
exhibit the
problem. My OS is Mac OS X 10.5.6 with JDK5. I'm using NetBeans 6.7, but not 
the GUI
builder, just straight Java. 

Please provide any additional information below.

// this is a test that show the problem (on my box).
public class ITunesTableTest {

    public static void main(String[] args) {

        // create itunes table
        String[][] data = new String[][]{
            {"A", "B", "C"},
            {"D", "E", "F"},
            {"G", "H", "I"}};

        String[] columnNames = {"One", "Two", "Three"};
        TableModel tm = new DefaultTableModel(data, columnNames);
        JTable t = MacWidgetFactory.createITunesTable(tm);

        JFrame frame = new JFrame();
        frame.add(t, BorderLayout.CENTER);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}

Original comment by eriksen...@gmail.com on 4 Sep 2009 at 1:38

GoogleCodeExporter commented 9 years ago
I may need to update the demo code -- I'll take a look.

Original comment by kenneth....@gmail.com on 4 Sep 2009 at 1:51

GoogleCodeExporter commented 9 years ago
Update to my previous post: the lack of table headers was due to my not 
wrapping the
table in a JScrollPane. (Sorry, I feel pretty stupid now... ;) ) 

Original comment by eriksen...@gmail.com on 5 Sep 2009 at 12:08

GoogleCodeExporter commented 9 years ago
OK, thanks for the update.

Original comment by kenneth....@gmail.com on 5 Sep 2009 at 6:44

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This is now works for me in the latest build that I just downloaded a minute 
ago!
Great :D

Original comment by eriksen...@gmail.com on 8 Sep 2009 at 10:07