<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: iTunes Style JTable</title>
	<atom:link href="http://www.laurendempster.com/2007/02/06/itunes-style-jtable/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.laurendempster.com/2007/02/06/itunes-style-jtable/</link>
	<description>More of a geek each day...</description>
	<pubDate>Sat, 05 Jul 2008 09:18:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: ayampanggang</title>
		<link>http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-6245</link>
		<dc:creator>ayampanggang</dc:creator>
		<pubDate>Sat, 29 Mar 2008 11:01:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-6245</guid>
		<description>this is a very good looking table, and yes it's hard to find good looking table for java so job well done!

but i think i have problems when trying to sort data by clicking at the column header. 
this is the error exception:
 java.lang.ClassCastException: models.HighlightModel cannot be cast to javax.swing.table.DefaultTableModel

which makes sense, since i derived my model from AbstractTableModel, but your table expects the model to be DefaultTableModel.

i hope the table will sometime support model which is derived from AbstractTableModel, maybe by simply disabling the sort, or even better by letting the programmer define their own sort function.

but this is a very beautiful table indeed!</description>
		<content:encoded><![CDATA[<p>this is a very good looking table, and yes it&#8217;s hard to find good looking table for java so job well done!</p>
<p>but i think i have problems when trying to sort data by clicking at the column header.<br />
this is the error exception:<br />
 java.lang.ClassCastException: models.HighlightModel cannot be cast to javax.swing.table.DefaultTableModel</p>
<p>which makes sense, since i derived my model from AbstractTableModel, but your table expects the model to be DefaultTableModel.</p>
<p>i hope the table will sometime support model which is derived from AbstractTableModel, maybe by simply disabling the sort, or even better by letting the programmer define their own sort function.</p>
<p>but this is a very beautiful table indeed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-5443</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Fri, 23 Nov 2007 09:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-5443</guid>
		<description>iam trying to use this awesome JTable but i got this exception then i try to add it in the JFrame.. (i use netbeans and have added the JTunesTable to the palette list so i can drag and drop it into my JFrame but i gor exceptions)..

the following execption has been thrown during painting of the form. Use Inspector to fix or remove the problem.
java.lang.NullPointException
at.ui.jtunestabe.JTunesTableCellRenderer.getTableCellRendererComponent(Unknown Source)
at javax.swing.JTable.preperRenderer(JTable.java:5683)

can someone help me out...</description>
		<content:encoded><![CDATA[<p>iam trying to use this awesome JTable but i got this exception then i try to add it in the JFrame.. (i use netbeans and have added the JTunesTable to the palette list so i can drag and drop it into my JFrame but i gor exceptions)..</p>
<p>the following execption has been thrown during painting of the form. Use Inspector to fix or remove the problem.<br />
java.lang.NullPointException<br />
at.ui.jtunestabe.JTunesTableCellRenderer.getTableCellRendererComponent(Unknown Source)<br />
at javax.swing.JTable.preperRenderer(JTable.java:5683)</p>
<p>can someone help me out&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-5421</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 21 Nov 2007 11:11:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-5421</guid>
		<description>How do i import this jar file into my project in netbeans??</description>
		<content:encoded><![CDATA[<p>How do i import this jar file into my project in netbeans??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JJ7</title>
		<link>http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-5033</link>
		<dc:creator>JJ7</dc:creator>
		<pubDate>Thu, 11 Oct 2007 15:28:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-5033</guid>
		<description>Hello, I think that is a great job and a wonderful style !!!

And run the .jar and I can see the example, but I having a problem to use it on my work.  I'm working with eclipse ide in a swing application.

Could someone please tell me how to use it ???</description>
		<content:encoded><![CDATA[<p>Hello, I think that is a great job and a wonderful style !!!</p>
<p>And run the .jar and I can see the example, but I having a problem to use it on my work.  I&#8217;m working with eclipse ide in a swing application.</p>
<p>Could someone please tell me how to use it ???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KJD</title>
		<link>http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-4483</link>
		<dc:creator>KJD</dc:creator>
		<pubDate>Fri, 29 Jun 2007 21:42:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-4483</guid>
		<description>Here's a clarification of the problem I'm having.  

Works: 

JTunesTable table = new JTunesTable(model);

Doesn't work:

JTunesTable table = new JTunesTable();
table.setModel(model);

I think the problem with the latter is that AutoCreateColumnsFromModel is set to false, and that's set to false because createColumnsFromModel resets style.  So my gut feeling is that to fix this issue will require overriding createColumnsFromModel with code that doesn't reset rendering.   I've given that a stab, but so far it's not working.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a clarification of the problem I&#8217;m having.  </p>
<p>Works: </p>
<p>JTunesTable table = new JTunesTable(model);</p>
<p>Doesn&#8217;t work:</p>
<p>JTunesTable table = new JTunesTable();<br />
table.setModel(model);</p>
<p>I think the problem with the latter is that AutoCreateColumnsFromModel is set to false, and that&#8217;s set to false because createColumnsFromModel resets style.  So my gut feeling is that to fix this issue will require overriding createColumnsFromModel with code that doesn&#8217;t reset rendering.   I&#8217;ve given that a stab, but so far it&#8217;s not working.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KJD</title>
		<link>http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-4464</link>
		<dc:creator>KJD</dc:creator>
		<pubDate>Tue, 26 Jun 2007 22:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-4464</guid>
		<description>Really nice work!  Very attractive.  

I am, however,  having some trouble making it work with the TableExample.java example that comes with Apple Developer Toolkit:

/Developer/Examples/Java/JFC/TableExample/TableExample.java

Has anyone successfully gotten JTunesTable to work with this example?  For me, nothing shows up.</description>
		<content:encoded><![CDATA[<p>Really nice work!  Very attractive.  </p>
<p>I am, however,  having some trouble making it work with the TableExample.java example that comes with Apple Developer Toolkit:</p>
<p>/Developer/Examples/Java/JFC/TableExample/TableExample.java</p>
<p>Has anyone successfully gotten JTunesTable to work with this example?  For me, nothing shows up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mats Mortensen</title>
		<link>http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-4199</link>
		<dc:creator>Mats Mortensen</dc:creator>
		<pubDate>Mon, 14 May 2007 22:29:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-4199</guid>
		<description>I am sorry. There is a small mistake in that code that will make selected rows black instead of blue. 

Replace the last 4 lines with:

---------------------------------------------------------------------
}
setBackground(new Color(100, 100, 100, 0));
}
super.paintComponent(g);
}
---------------------------------------------------------------------</description>
		<content:encoded><![CDATA[<p>I am sorry. There is a small mistake in that code that will make selected rows black instead of blue. </p>
<p>Replace the last 4 lines with:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
}<br />
setBackground(new Color(100, 100, 100, 0));<br />
}<br />
super.paintComponent(g);<br />
}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mats Mortensen</title>
		<link>http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-4198</link>
		<dc:creator>Mats Mortensen</dc:creator>
		<pubDate>Mon, 14 May 2007 21:14:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.laurendempster.com/2007/02/06/itunes-style-jtable/#comment-4198</guid>
		<description>Excellent work you have done! I am attempting to use your jtunes table in my application and it looks beautiful! 

However, I have some tips to how the performance can be improved. Compared to a regular JTable it is in its current form about 3-5 times as slow.   Here are the tricks I found that make a huge difference:

- Make JTunesTableCellRenderer and JTunesHeaderRenderer extend DefaultTableCellRenderer instead of JLabel (makes some unnecessary methods noop)

- The paintComponent(Graphics g) in JTunesTableCellRenderer seems to work better when changed to:

-----------------------------------------------------------------------------------
public void paintComponent(Graphics g) {
	if (systemColor) {
		if (selected) {
			setForeground(systemHighlightTextColor);
			setBackground(systemHighlightColor);
		}
		super.paint(g);
		return;

		} else {
			if (selected) {
				Graphics2D g2 = (Graphics2D) g;
				g2.setPaint(getGradientPaint());
				Rectangle2D drawRect = new Rectangle2D.Double(0, 0, getWidth(), getHeight());
				g2.fill(drawRect);
			} else {
				Color bgColor = getBackground();
				g.setColor(bgColor);
				g.fillRect(0, 0, getWidth(), getHeight());
				setForeground(selectedColor);
			}
		}
		super.paintComponent(g);
}
-----------------------------------------------------------------------------------


Although I am not sure the paintComponent trick will work on all platforms? If you have any other ways to improve performance I would be very grateful!</description>
		<content:encoded><![CDATA[<p>Excellent work you have done! I am attempting to use your jtunes table in my application and it looks beautiful! </p>
<p>However, I have some tips to how the performance can be improved. Compared to a regular JTable it is in its current form about 3-5 times as slow.   Here are the tricks I found that make a huge difference:</p>
<p>- Make JTunesTableCellRenderer and JTunesHeaderRenderer extend DefaultTableCellRenderer instead of JLabel (makes some unnecessary methods noop)</p>
<p>- The paintComponent(Graphics g) in JTunesTableCellRenderer seems to work better when changed to:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
public void paintComponent(Graphics g) {<br />
	if (systemColor) {<br />
		if (selected) {<br />
			setForeground(systemHighlightTextColor);<br />
			setBackground(systemHighlightColor);<br />
		}<br />
		super.paint(g);<br />
		return;</p>
<p>		} else {<br />
			if (selected) {<br />
				Graphics2D g2 = (Graphics2D) g;<br />
				g2.setPaint(getGradientPaint());<br />
				Rectangle2D drawRect = new Rectangle2D.Double(0, 0, getWidth(), getHeight());<br />
				g2.fill(drawRect);<br />
			} else {<br />
				Color bgColor = getBackground();<br />
				g.setColor(bgColor);<br />
				g.fillRect(0, 0, getWidth(), getHeight());<br />
				setForeground(selectedColor);<br />
			}<br />
		}<br />
		super.paintComponent(g);<br />
}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Although I am not sure the paintComponent trick will work on all platforms? If you have any other ways to improve performance I would be very grateful!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
