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


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

Re: update after modifyin

From "a" <a@THRWHITE.remove-dii-this>
Subject Re: update after modifyin
Message-ID <Fwcgj.21433$uV6.16102@pd7urf1no> (permalink)
Newsgroups comp.lang.java.gui
References <47811cce$0$27797$b9f67a60@news.newsdemon.com>
Date 2011-04-27 15:42 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
I am able to add the component to the JList lives on the JPanel. But I have
to resize the JFrame to see the update, if I add the component on the fly.
JTextArea is not bad for adding and showing data dynamically. However, I may
need to show the icons with text together in the future. So, what kind of
component is the best?

Thanks for your reply.

"Knute Johnson" <nospam@rabbitbrush.frazmtn.com>
???????:47811cce$0$27797$b9f67a60@news.newsdemon.com...
> a wrote:
> > Hi
> >
> > I need to modify the content of the JList on the fly. So, when I need to
> > update the JList, I rebuild the list model and re-initiate the JList by
> > using new operator. I need to resize the JFrame manually to see the new
> > JList. How should I program it to show the new JList right after I
modifying
> > it?
> >
> > Is JList a good component for dynamic list content?
> >
> > Thanks
> >
> >
>
> I suspect that you are having troubles adding and removing components
> not really with the JList.  But since we can't see your code it is hard
> to tell.
>
> JList and the DefaultListModel are really good for adding and removing
> elements one at a time.  If you are going to completely change the
> content of the list maybe another component would work better for you.
> I have similar requirement in a program that I am working on and I use a
> JTextArea as a list component.  Periodically I have to update that
> component and I just set new content on it.  Also it lives in a
> JScrollPane so that I don't have to resize my frame to make it fit if
> the content suddenly exceeds the original size.
>
> -- 
>
> Knute Johnson
> email s/nospam/knute/
>
> --
> Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
>       ------->>>>>>http://www.NewsDem

---
 * 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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

update after modifying th "a" <a@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000
  Re: update after modifyin "Knute Johnson" <knute.johnson@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000
    Re: update after modifyin "a" <a@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000
      Re: update after modifyin "Knute Johnson" <knute.johnson@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000
  Re: update after modifyin "James" <james@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000
  Re: update after modifyin "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000

csiph-web