GCC Bugzilla – Attachment 11403 Details for
Bug 27482
null ImageIcon in JTable is displayed with the previous row value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
TestCase showing the same image displayed twice
JTableImageIcon.java (text/x-java), 822 bytes, created by
Yvan Norsa
on 2006-05-08 09:41:42 UTC
(
hide
)
Description:
TestCase showing the same image displayed twice
Filename:
MIME Type:
Creator:
Yvan Norsa
Created:
2006-05-08 09:41:42 UTC
Size:
822 bytes
patch
obsolete
>import javax.swing.ImageIcon; >import javax.swing.JFrame; >import javax.swing.JPanel; >import javax.swing.JTable; > >import javax.swing.table.AbstractTableModel; >import javax.swing.table.TableModel; > >public class JTableImageIcon { > public static void main(String[] args) { > JFrame f = new JFrame(); > JPanel p = new JPanel(); > > TableModel dataModel = new AbstractTableModel() { > public int getColumnCount() { > return 1; > } > > public int getRowCount() { > return 2; > } > > public Class getColumnClass(int c) { > return ImageIcon.class; > } > > public Object getValueAt(int r, int c) { > if (r == 0) { > return new ImageIcon("foo.jpg"); > } > > return null; > } > }; > > JTable t = new JTable(dataModel); > p.add(t); > > f.setContentPane(p); > f.setSize(100, 100); > f.setVisible(true); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 27482
: 11403