Question

So. The ideas have been a few.. no good ones.. So here is the problem i have incountered and can not figure out a solution for.

I need to have a txt file containing a hierarchical list of things to do, looking something like this:

  • Ask a question
    • Before question asked, check similar questions
    • Formulate the question so that the problem is clearly shown.
  • Post the question
    • Hold your thumbs that this might save your day.

The txt file should in the program fill a list shown in a JPanel and after each step have a checkbox to comfirm "I have been a good boy and done this". The list can change over time and grow and shrink, so the solution needs a scrollbar. The list should also contaion a capability to show more the one row.

The solution im working on is done in Jave compiler 1.6 and im using Swing for my layout. Ideas i have had so far are: Modified JTable... and the other solutions i am asshamed of.. And thats about it.. ..

Was it helpful?

Solution

JTree with custom renderer. The renderer should be a panle with checkbox and text area.

OTHER TIPS

Also consider org.netbeans.swing.outline.Outline, discussed here and illustrated below. It's not apparent in the screenshot, but the the Outline instance has been added to a JScrollPane.

image

I would say JTreeTable is a right choice. It will provide a lot of power and flexibility. Please see some very basic examples:

For any serious purpose please use a mature implementation provided, for example, by a SwingLab project:

Please also see the following answer:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top