• Post Reply Bookmark Topic Watch Topic
  • New Topic

Manipulate an image, or another way to do this in a JTable

 
Ralph Cook
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTable in which the first column represents an object which has an "indent level" in relation to other rows; think of a root drive and the directories under it, and then the directories under them, etc. Other rows in that column obviously have some information about the object which name is in the first column.

The program allows the user to "open" (or "close") the row; opening it means to examine those things "beneath" it.

I want to put an icon in the first column that represents both the open/closed state of the row, and represents the indentation level of the row. It's like the left-hand lower panel in a Windows Explorer window, showing folders; they have a + to represent an unopened folder, and indent further to the right as the levels go down. That's the kind of thing I want in this table.

So I have two questions:

1. Can I have a couple of images to represent open/close state and then manipulate them somehow for indentation? I know there's an entire JAI for "manipulating images", and if that's where I need to look for this, fine -- I was hoping someone could point me to a couple of keywords, classes, and methods to examine that have to do with this particular thing, so that I didn't have to spend days learning the entire API just to do this.

2. Is there another overall approach someone can suggest?

tia,
rc
 
Darryl Burke
Bartender
Posts: 5153
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. There's a separate forum for Swing / AWT / SWT / JFace
2. Your description appears to be of a JTreeTable (not a part of hte standard API -- search the net).
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:1. There's a separate forum for Swing / AWT / SWT / JFace

Indeed. Moving this thread there.
 
Ralph Cook
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, sorry I didn't put this in the Swing forum in the first place.

I've looked up JTreeTable, and that does indeed do a lot of what I was looking for. Unfortunately, the 2nd article (with the really interesting stuff in it) is missing a source file. He has one of these sections where each file name is a link, only one of the ones that I really need (FileSystemModel2.java) is missing its link. I've searched the net and tried the google cache to no avail.

Does one of you Swing people by any chance have the above source file for that example?

rc
 
Ralph Cook
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind -- found it at koders.com

Off to study...

rc
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!