Hi,

I have created a table with first column as checkbox.
Using the below Code..

    TableColumn tc = constructedTable.getColumnModel().getColumn(0);
    tc.setCellEditor(constructedTable.getDefaultEditor(Boolean.class));
    tc.setCellRenderer(constructedTable.getDefaultRenderer(Boolean.class));
    tc.setHeaderRenderer(new CheckBoxHeader(new MyItemListener()));

I sometimes get stackoverflow exception.
Is This beacause of the above code..?

Recommended Answers

All 2 Replies

Can't pin point the exception cause by looking at that small piece of codes... Usually, it is from a loop that does not end properly. As a result, the program keeps creating references/objects in the memory. I used the word references because it includes more than just Java objects.

Stack overflow is usually caused by recursively calling a method from itself. (Too many objects created normally throws a OutOfMemoryError exception, not a stack obverflow.) The error messgae tells you the exact line in your code where it happened. Without that info we can't do anything.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.