Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2192

Text of JTree

From "Chiara" <chiara@THRWHITE.remove-dii-this>
Subject Text of JTree
Message-ID <1186135565.729022.237020@22g2000hsm.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
Date 2011-04-27 15:37 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
Hi,
I'm new in programming with java and so my question is very simple.
I have created a JTree containing a certain object, but I want that
the displayed text was different.
My code is the following, it doesn't chance the text but I don't know
why.

UIdata UIdataExp = new UIdata(); //my object
UIdataExp.fromDBNotInstalled(1);
DefaultMutableTreeNode root = new DefaultMutableTreeNode(UIdataExp);//
only root to try
DefaultTreeModel treeModel = new DefaultTreeModel(root);
 jTree1.setModel(treeModel);
jTree1.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
renderer.setText(UIdataExp.getPN());//it is a String
jTree1.setCellRenderer(renderer);

thank a lot
Chiara

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Text of JTree "Chiara" <chiara@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
  Re: Text of JTree "Sabine Dinis Blochberger" <sabine.dinis.blochberger@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
    Re: Text of JTree "Chiara" <chiara@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000

csiph-web