🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12977

Re: JTable

#12977
From: Anne JANSSENS
Date: Wed, 14 Oct 1998 00:00
37 lines
1912 bytes
Answer to 2)
As you said, there are two different kinds of event that you want to catch
    - event when columns are resized
    - event when containers of JTable are resized

-> Resized Event on column :
you can catch this event if you implement the PropertyChangerListener in
package java.beans.*
and you add on each TableColumn ( columns of your Table ) :
addPropertyChangeListener(yourlistener)
Then in the function that you rewrite :
void propertyChange(PropertyChangeEvent evt)
{ // you can know the kind of event by testing :
  if (evt.getPropertyName()=="columWidth")
  {  // to know the index of the column in the JTable
     mytablemodel.getColumnIndex(evt.getSource().getIdentifier());
    // do what ever you want
  }
}

-> Resized Event on Container
you can catch resize event on every kind of container by implementing the
ComponentListener
and add to your container mycontainer.addComponentListener(mylistener);
Then you rewrite the function : void componentResized(ComponentEvent evt).
To know the container that fired the event test evt.getComponent(). Then you
do what ever you want ...

Answer to 1)
I think you can have as a CellEditor a TextPane, but I think that you can
not have
in your Table rows with different height, you can say that your table must
have your row's height
but it is for all the rows of your table : mytable.setRow(....)

Hope it would help you
Anne
Technical Details
Message-ID: <702jv8$k0r31@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36192C44.C6C1EC8D@collegemail.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,766ebeacf7730ae9
X-Google-Attributes: gid111d45,public
From: "Anne JANSSENS" <recherche@generix.fr>
Subject: Re: JTable
Date: 1998/10/14
Message-ID: <702jv8$k0r31@forums.borland.com>
X-Deja-AN: 401033746
References: <36192C44.C6C1EC8D@collegemail.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing