Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #13792
| Path | csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | Jan Burse <janburse@fastmail.fm> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: swing component? |
| Date | Sun, 22 Apr 2012 17:12:55 +0200 |
| Organization | albasani.net |
| Lines | 39 |
| Message-ID | <jn175o$9u8$1@news.albasani.net> (permalink) |
| References | <24010092.561.1335104359317.JavaMail.geo-discussion-forums@pbckz3> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.albasani.net t+AlWM4uE1czaxSkBj0Iw6DPmzXp72c72S5+vG9LWKR4PLjKGavxPZjxyBk2+PfXi30ObZBTOaWGFPy8xM55mlDDzKNT3wWgMmomet5ETyQqAmUJ0oVINycF0wNAxOea |
| NNTP-Posting-Date | Sun, 22 Apr 2012 15:12:56 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="C/g3Uf03y1TpZQb7wnUkuQomOU/RnEkY7mQSoF6FofcHmGmr38QU72Lg+2urPPdxQ9COxDJylCjmrJP9N08NNrX7KdW5kFszHIQs5cEU28G+wKTesCDJpUy6EC0fMhtv"; mail-complaints-to="abuse@albasani.net" |
| User-Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120312 Firefox/11.0 SeaMonkey/2.8 |
| In-Reply-To | <24010092.561.1335104359317.JavaMail.geo-discussion-forums@pbckz3> |
| Cancel-Lock | sha1:I0ZGs+hXjt3qptwFVoyukQZHok0= |
| Xref | csiph.com comp.lang.java.programmer:13792 |
Show key headers only | View raw
Peter Cheung schrieb:
> Hi All, does swing component provide something like:
>
> component.setProperty("whatever", "value"); ??
>
> thanks
> from Peter (cmk128@hotmail.com)
Hi,
You can attach client data to a Swing component.
The methods are:
public class JComponent {
/**
* Adds an arbitrary key/value "client property" to this component.
*/
public void putClientProperty(Object key, Object value);
/**
* Returns the value of the property with the specified key.
*/
public Object getClientProperty(Object key);
}
But you must assure that the key does not clash
with a key already used internally by Swing.
Easiest is to use a key that resembles in the prefix
one of your package names.
For example:
myTable.putClientProperty("com.mycompany.mypackage.mykey", "value");
Bye
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
swing component? Peter Cheung <cmk128@gmail.com> - 2012-04-22 07:19 -0700
Re: swing component? markspace <-@.> - 2012-04-22 07:47 -0700
Re: swing component? "Qu0ll" <Qu0llSixFour@gmail.com> - 2012-04-23 01:05 +1000
Re: swing component? Jan Burse <janburse@fastmail.fm> - 2012-04-22 17:12 +0200
Re: swing component? Jan Burse <janburse@fastmail.fm> - 2012-04-22 17:18 +0200
Re: swing component? markspace <-@.> - 2012-04-22 10:10 -0700
Re: swing component? Peter <mcheung63@gmail.com> - 2012-04-24 06:44 -0700
Re: swing component? Roedy Green <see_website@mindprod.com.invalid> - 2012-04-27 05:06 -0700
Re: swing component? Roedy Green <see_website@mindprod.com.invalid> - 2012-04-24 08:52 -0700
csiph-web