質問

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.. ..

役に立ちましたか?

解決

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

他のヒント

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:

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top