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


Groups > comp.lang.java.gui > #1673 > unrolled thread

JXxxx.setEditable(boolean

Started by"RC" <rc@THRWHITE.remove-dii-this>
First post2011-04-27 15:34 +0000
Last post2011-04-27 15:34 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.lang.java.gui


Contents

  JXxxx.setEditable(boolean "RC" <rc@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
    Re: JXxxx.setEditable(boo "Tom Hawtin" <tom.hawtin@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
      Re: JXxxx.setEditable(boo "RC" <rc@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000

#1673 — JXxxx.setEditable(boolean

From"RC" <rc@THRWHITE.remove-dii-this>
Date2011-04-27 15:34 +0000
SubjectJXxxx.setEditable(boolean
Message-ID<f32a97$kng$1@news.nems.noaa.gov>
  To: comp.lang.java.gui,comp.l
There is setEditable(boolean b) method in JTree class.
But I can't found the similar method in
JTable, JTextField, etc.

I don't want user edit the cells in my JTable or JTextField.
How do I do that?

Thank_Q very much in advance()!

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

[toc] | [next] | [standalone]


#1674 — Re: JXxxx.setEditable(boo

From"Tom Hawtin" <tom.hawtin@THRWHITE.remove-dii-this>
Date2011-04-27 15:34 +0000
SubjectRe: JXxxx.setEditable(boo
Message-ID<4654b633$0$8744$ed2619ec@ptn-nntp-reader02.plus.net>
In reply to#1673
  To: comp.lang.java.gui,comp.l
RC wrote:
> There is setEditable(boolean b) method in JTree class.
> But I can't found the similar method in
> JTable, JTextField, etc.
> 
> I don't want user edit the cells in my JTable or JTextField.
> How do I do that?

JTextField has setEditable. It's inherited from JTextComponent.

For JTable, use a TableModel that always returns false from 
isCellEditable. (Or extend JTable and override its isCellEditable.) For 
tables, using TableModel is usually the way to go.

Tom Hawtin

[Followup-To: comp.lang.java.gui]

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

[toc] | [prev] | [next] | [standalone]


#1679 — Re: JXxxx.setEditable(boo

From"RC" <rc@THRWHITE.remove-dii-this>
Date2011-04-27 15:34 +0000
SubjectRe: JXxxx.setEditable(boo
Message-ID<46559816.1010708@nospam.noaa.gov>
In reply to#1674
  To: Tom Hawtin
Tom Hawtin wrote:

> 
> JTextField has setEditable. It's inherited from JTextComponent.
> 
> For JTable, use a TableModel that always returns false from 
> isCellEditable. (Or extend JTable and override its isCellEditable.) For 
> tables, using TableModel is usually the way to go.

Thank Q very very much!

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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web