0

I've seen a few examples on this site where people working with JTables declare the following:

 List<TableColumn> columns = new ArrayList<TableColumn>();

I'd like to do this too, as my goal is to create a list that will store columns that are hidden from the user (I need the list so that I can un-hide the columns later if need be).

However, when I try the above eclipse tells me:

The type List is not generic; it cannot be parameterized with arguments

Can someone tell me how to fix this? Or suggest another option?

2
  • 1
    consider JXTable (part of SwingX) which supports hidden columns Commented Jan 10, 2014 at 16:02
  • @kleopatra hey, JXTable works great! Thanks a lot for the tip. Commented Jan 10, 2014 at 16:34

2 Answers 2

1

You must have imported the wrong List class.

Make sure you have java.util.List; As opposed to java.awt.List; or some other list.

Sign up to request clarification or add additional context in comments.

Comments

1

You can check out Table Column Manager. It provides hide/show functionality for the TableColumns.

It is designed to allow the user to control which columns are displayed/hidden but you can turn that off by using setMenuPopup(false).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.