2

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

mKorbel
  • 109,107
  • 18
  • 130
  • 305
Pewdut
  • 35
  • 2
  • 9

4 Answers4

2

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

StanislavL
  • 56,113
  • 9
  • 64
  • 93
2
mKorbel
  • 109,107
  • 18
  • 130
  • 305
  • Wish i could upvote, cause this awnser helpt me alot too! Tho the solution was in the other awnser the way there was throw yours! – Pewdut Oct 18 '12 at 06:47
2

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

Community
  • 1
  • 1
trashgod
  • 200,320
  • 28
  • 229
  • 974
1

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:

Community
  • 1
  • 1
Renat Gilmanov
  • 17,479
  • 5
  • 37
  • 55
  • shaking head on these outdated references: they are the very first attempt (more a case study than usable) with tons of problems which are fixed (not all though, though) in JXTreeTable ... – kleopatra Oct 13 '12 at 08:29
  • I'm suggesting an idea, but not the actual implementation. – Renat Gilmanov Oct 13 '12 at 19:25