bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug swing/26521] JTable does not initialise correctly, testcase include


From: asraniel at fryx dot ch
Subject: [Bug swing/26521] JTable does not initialise correctly, testcase included
Date: 1 Mar 2006 19:50:00 -0000


------- Comment #1 from asraniel at fryx dot ch  2006-03-01 19:50 -------
sorry, pressed enter by mistake..

So here the testcase:

import java.awt.Component;

import javax.swing.JButton;
import javax.swing.JTable;

public class JTableTest {

        public static void main(String[] args) {
                JTable test = new JTable();
                try{
                        if(test.getComponentCount() != 1){
                                System.out.println("test.getComponentCount() is
not 1 but "+test.getComponentCount());
                        }                       
                        Component comp = new JButton();
                        test.add(comp);
                        if(test.getComponentCount() != 2){
                                System.out.println("test.getComponentCount() is
not 2 but "+test.getComponentCount());
                        }
                        System.out.println("Test 1 suceeded");
                }catch(Exception e){
                        System.out.println("Error 1:\n");
                        e.printStackTrace();
                }

                test = new JTable();
                try{
                        System.out.println("Component type is:
"+test.getComponent(0).getClass().getName());
                        System.out.println("Test 2 suceeded");
                }catch(Exception e){    
                        e.printStackTrace();
                        System.out.println("Error 2: Class should be:
javax.swing.CellRendererPane");                   
                }
        }

}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26521





reply via email to

[Prev in Thread] Current Thread [Next in Thread]