Optimizing a dynamic JList

Hi-
I have a JList that has a background thread dynamically adding entries to the ListModel. (it only adds, and always to the end of the list). It does this very quickly (many times per second), which causes the JList & its JScrollPane to flicker & reset its scroll position and also occasionally become unresponsive to input. Does anyone have ideas on how to control its refreshing so a) the scroll position does not reset and b) it queues up refreshes to once every 5 seconds or so?
I think I can handle b) from the thread that updates the ListModel, but am not sure about a). Thanks.
Carlos Hwa

Throttling down the update may have fixed your immediate problem, but the problem shouldn't be there at all.
I did not post some code because it is all written on an internal network & it is very difficult for us to transfer code to the internet.An SSCCE is not supposed to be your 'real code'. Didn't you read the page linked?
This is an SSCCE that adds an element to a JList every millisecond and still does not show any flicker or rescrolling.import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class DynamicList {
  JList list;
  int count;
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        new DynamicList().makeUI();
  public void makeUI() {
    list = new JList(new DefaultListModel());
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(400, 400);
    frame.setLocationRelativeTo(null);
    frame.add(new JScrollPane(list));
    frame.setVisible(true);
    new Timer(10, new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        ((DefaultListModel) list.getModel()).addElement("Item " + count++);
    }).start();
}Your problem is elsewhere in your code.
db

Similar Messages

  • Dynamic JList

    I'm working on making a configuration panel for one of my programs, and I've finally gotten around to implementing a dynamic 'module' loader.
    The modules are loaded and the config panel contains a JList that switches to a JPanel represented by the menu entry, via CardLayout.
    I also made an EntryListModel for the list, which is a model that has a LinkedList containing all of the values, as well as add and remove methods (wrappers to the list). My goal is to have the 'add' method add an entry to the list.
    The problem is that entries are never added to the list. I wrote all of the basic code, and added a debug System.out.println() call to print the output of the list's size() method whenever EntryListModel.size() was called.
    By doing this, I see '2' in the terminal (two hard-coded entries), but nothing in the JList. Is there some sort of update method I need to call to have the list reflect the changes?
    All the code can be found at http://timothyb89.homelinux.org/kdrepos/JTelIRC/core/src/jtelirc/mods/ with the actual config panel at http://timothyb89.homelinux.org/kdrepos/JTelIRC/core/src/jtelirc/gui/jcontrolpanel/JControlPanel.java and the EntryListModel at http://timothyb89.homelinux.org/kdrepos/JTelIRC/core/src/jtelirc/gui/jcontrolpanel/EntryListModel.java
    I know that the control panel, if anything, is poorly coded. Would it be better to simply rewrite it, or is a simple fix and code improvement later the best way to go?
    --Thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Just looking briefly, I'm assuming the following code block is where you update the list:
           //update the list
            mods_list.setModel(new javax.swing.AbstractListModel() {
                        Action[] mods;
                        public int getSize() {
                            populateModal();
                            return mods.length;
                        public Object getElementAt(int i) {
                            populateModal();
                            return mods;
    public void populateModal() {
    //get the list of mods
    List<Action> mods = VarStorage.get().getActionInstances();
    this.mods = mods.toArray(new Action[0]);
    If so, I can't see where you're firing change events (which prompt the View to refresh). Here's an extension of AbstractListModel, which illustrates what I mean:
    import javax.swing.*;
    import java.util.*;
    public final class BasicListModel<T extends Object> extends AbstractListModel {
      private List<T> data = new ArrayList<T>();
      public BasicListModel() {
        super();
      public BasicListModel(Collection<T> items) {
        setData(items);
      public BasicListModel(T[] items) {
        setData(items);
       * Sets {@link #data} and calls {@link #fireIntervalAdded}.
      public void setData(T[] items) {
        int oldSize = data.size();
        data.clear();
        for (T element : items) {
          data.add(element);
        fireIntervalAdded(this, 0, data.size() != 0 ? data.size() - 1 : 0);
       * Sets {@link #data} and calls {@link #fireIntervalAdded}.
      public void setData(Collection<T> items) {
        int oldSize = data.size();
        data.clear();
        data.addAll(items);
        fireIntervalAdded(this, 0, data.size() != 0 ? data.size() - 1 : 0);
       * Implements <code>ListModel</code>.
      @Override
      public Object getElementAt(int index) {
        return data.get(index);
       * Implements <code>ListModel</code>.
      @Override
      public int getSize() {
        return data.size();
    }In order to dynamically update the list, I only set the model at construction using JList(ListModel) and thereafter the setData() method on BasicListModel above is called to effect the update.
    Hope this helps,
    Lance

  • Optimizing a dynamic calc

    Hi In our measures dimension we have a MTD member, which is a dynamic calc.The formula is:if (not @ISLEV (Time,0))"AIP-Sales";else@SUMRANGE("AIP-Sales",@ILSIBLINGS(@CURRMBR(Time)));endif;The problem is that it takes very long to fetch on this member.If I just put in if (not @ISLEV (Time,0))"AIP-Sales";else"AIP-Sales";endif;the fetch is instantaneous but whith the first fetch it takes 30 seconds even when fetching on an upper level member of time. Does Essbase evaluate the full expression regardles of the if statement?Time is a dense dimension, with the isolated dates beiing lvl 0, months lvl 1 then qtrs etc.The strange thing is that with the first formula it retrieves 3 blocks, even though there are no references outside the current block.With the second formula only 1 block is fetched as should be expected.Soren

    Check out"Dynamic Time Series"in the Essbase documentation.Machismo

  • Reducing form load in Adobe Reader / Optimizing Interactive Dynamic Forms

    I have a four page form that is taking approximately a minute to minute and a half on my T61P with 3 Gigs and Intel Pentium CoreDuo T7500 @ 2.2GHz. Everything loads up fine so it is only this pdf that is the problem.
    Can someone help me or point me to a resource that shows how to tune this form to reduce the load time in Reader. BTW I am on LC ES 8.2 and Acrobat 9 Pro Extended. I am using Acrobat 9.0 Reader exclusively for a Reader.

    I checked your forms, tried following on my end and it seems to be working as expected with this one little change......
    You housed section 12 in a subform named "Subform2" and set Min Count 1 under Object>>Binding tab......Now I also set "Initial Count" as "0" which seems to have fixed issue but not the good practice to follow. Try it out on your end and see if that is the case....
    However I suspect this issue is primarily caused by the way you have your layout designed....I noticed you have your form designed with few subforms as well as few open items not wrapped under subform which may be causing this issue.

  • Dynamically resize JTable cell to fit a JList

    Hi!
    I've been banging my head trying to add some dynamic behavior to a TableCellEditor. In short I'm trying trying to make it resize the height of the current row (the one it is in) to reflect the changes made to the JList used to let the user edit the cells value (which is a list of items).
    I've come across some threads dealing with the problem of resizing a cell to fit its content. This however is usually only done once (in the 'getTableCellEditorComponent' function) and so only provides half the answer. Also, since the editor is only active during cell editing I've been trying to make it revert to the old cell height after the editing is done.
    So far I have not come up with any decent solution to this problem and was hoping someone out there might have an idea or have read something similar and can point me to something helpful... anyone?
    Cheers!
    Teo

    The Swing tutorial on[url http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]How to Use Tables shows how to dynamically change the size to Table Columns.
    If you need help calculating the acutal size then try searching the forum. Using keywords "resize jtable column" (keywords I took directly from your topic title) I found some promising postings.

  • Dynamically updating JList.

    This is my code snippet for showing images as a preview in scrollpane.
    In ListTableModel, u can get the Jlist and scrollpane of the JList.
    setFileStats method is used to set those data (images) into the JList after making imageicon from the filepath which is available in ImageName vector. It is showing all the images in preview mode at a time after setting everything in jList, but i want to show the every images loading in JList dynamically.
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.ListDataListener;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    import java.util.Vector;
    public class ListTableModel extends AbstractListModel {
         public Vector data = new Vector();
         public JList localList;
         public JScrollPane tempPane;
         public ListTableModel(JList initList, JScrollPane argPane) {
              localList = initList; //Here i am pasing the list and scrollpane.
              tempPane = argPane;
              initList.setCellRenderer(new IVMListCellRenderer());
         public Object getElementAt(int index) {
              return (data.get(index));
         public int getSize() {
              return data.size();
         public void addListDataListener(ListDataListener ldl) {
              // since the list never changes, we don't need this :-)
         public void removeListDataListener(ListDataListener ldl) {
              // since the list never changes, we don't need this :-)
         public void setFileStats(Vector imageNames) {
              //data = new Object [imageNames.size()];
              data = new Vector();
              for ( int i = 0; i < imageNames.size(); i++ ) {
                        ImageIcon newScaled = new ImageIcon((String)imageNames.get(i));
                        newScaled.setDescription((String)imageNames.get(i));
                        data.add(newScaled);
                        localList.setListData(data);
                        fireIntervalAdded(data, 0, i);
                        fireContentsChanged(data, 0 , getSize());
                        localList.revalidate();
                        tempPane.revalidate();
                        localList.ensureIndexIsVisible(i);
    class IVMListCellRenderer extends DefaultListCellRenderer {
         public IVMListCellRenderer()
              setOpaque(true);
         public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
              super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
              ImageIcon tempValue = (ImageIcon)value;
              setIcon(tempValue);
              int lastPosition = tempValue.getDescription().lastIndexOf("/");
              String sizeOfStR = tempValue.getDescription().substring(lastPosition + 1);
              setText(sizeOfStR);
              return this;
    }

    This is my code snippet for showing images as a preview in scrollpane.
    In ListTableModel, u can get the Jlist and scrollpane of the JList.
    setFileStats method is used to set those data (images) into the JList after making imageicon from the filepath which is available in ImageName vector. It is showing all the images in preview mode at a time after setting everything in jList, but i want to show the every images loading in JList dynamically.
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.ListDataListener;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    import java.util.Vector;
    public class ListTableModel extends AbstractListModel {
         public Vector data = new Vector();
         public JList localList;
         public JScrollPane tempPane;
         public ListTableModel(JList initList, JScrollPane argPane) {
              localList = initList; //Here i am pasing the list and scrollpane.
              tempPane = argPane;
              initList.setCellRenderer(new IVMListCellRenderer());
         public Object getElementAt(int index) {
              return (data.get(index));
         public int getSize() {
              return data.size();
         public void addListDataListener(ListDataListener ldl) {
              // since the list never changes, we don't need this :-)
         public void removeListDataListener(ListDataListener ldl) {
              // since the list never changes, we don't need this :-)
         public void setFileStats(Vector imageNames) {
              //data = new Object [imageNames.size()];
              data = new Vector();
              for ( int i = 0; i < imageNames.size(); i++ ) {
                        ImageIcon newScaled = new ImageIcon((String)imageNames.get(i));
                        newScaled.setDescription((String)imageNames.get(i));
                        data.add(newScaled);
                        localList.setListData(data);
                        fireIntervalAdded(data, 0, i);
                        fireContentsChanged(data, 0 , getSize());
                        localList.revalidate();
                        tempPane.revalidate();
                        localList.ensureIndexIsVisible(i);
    class IVMListCellRenderer extends DefaultListCellRenderer {
         public IVMListCellRenderer()
              setOpaque(true);
         public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
              super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
              ImageIcon tempValue = (ImageIcon)value;
              setIcon(tempValue);
              int lastPosition = tempValue.getDescription().lastIndexOf("/");
              String sizeOfStR = tempValue.getDescription().substring(lastPosition + 1);
              setText(sizeOfStR);
              return this;
    }

  • JList dynamically adding items

    I am inserting items into a Jlist dynamically by reading from a network port .The items get added but my problem is list box always shows the top portion of the list.
    Is there any way i can make the list to scroll down as and when i add items into it.
    Thanks

    No its still not working i am doing in an applet
    heres my code
    public class QueryResults extends JApplet implements Runnable{
            Thread resultReader =null;
            Socket sock =null;
            BufferedReader in =null;
            PrintWriter pw =null;
            JList resultList = new JList(new DefaultListModel());
            JScrollPane sp =new JScrollPane(resultList);
            public void init(){
                try{
                    sock= new Socket("localhost", 4444);
                    pw=new PrintWriter(sock.getOutputStream(), true);
                    in=new BufferedReader(new InputStreamReader( sock.getInputStream()));
                    resultList.ensureIndexIsVisible(resultList.getModel().getSize());
                    sp.setAutoscrolls(true);
                    Container contentpane=getContentPane();
                    contentpane.setLayout(new FlowLayout());
                    contentpane.add(sp);
                }catch(IOException e){
                    e.printStackTrace();
            public void start(){
                resultReader=new Thread(this);
                resultReader.start();
            public void run(){
                try{
                    String line;
                    while((line=in.readLine())!= null){
                        ((DefaultListModel)resultList.getModel()).addElement(line);
                        resultList.repaint();
                        SwingUtilities.invokeLater(new Runnable(){public void run()
                            sp.getVerticalScrollBar().getModel().setValue(sp.getVerticalScrollBar().getModel().getMaximum());
                            //spane.getVerticalScrollBar().setValue(spane.getVerticalScrollBar().getMaximum() );
                        //resultList.ensureIndexIsVisible(resultList.getModel().getSize());
                        //resultList.repaint();
                        //sp.getVerticalScrollBar().getModel().setValue(sp.getVerticalScrollBar().getModel().getMaximum());
                }catch(IOException e){
                    e.printStackTrace();
            public void stop(){
                try{
                    pw.close();
                    in.close();
                    sock.close();
                }catch(IOException e){
                    e.printStackTrace();
    }

  • JList adding Icons+Text String  dynamically adding elements

    Hi
    is it possible in JList to add Icons with image .
    also if i want to add the element dynamically what will be the procedure ?
    If possible plz inform me ....
    at [email protected]

    The JList tutorial explains both how to use icons and how to add elements dynamically. And it has code examples too. You will find it here:
    "How to Use Lists":
    http://java.sun.com/docs/books/tutorial/uiswing/components/list.html

  • Detecting the optimal upload bandwidth of cam video stream (Dynamic Bandwidth Detection Approach)

    Hello folks,
    i am discovering the wide world of adobe technologies and i am impressed how seamless all is working.
    Anyway i have a tricky problem, at least it seems tricky to me. Here we go: i build up a client (camera+audio conferencing) streaming its camera right to my server (red5). Every client can see the camera streams of each connected particpant. So far so good all is working as expected, we can call this a conferencing solution. Now i would like to improve that by implementing some kind of automatic bandwidth detection in order to adjust the video resolution depending on the current bandwidth "situation" of every participant. Some might have stronger upload bandwidth, some might have a bad or even too low upload bandwidth to even up-stream their video. My client should be able to handle them individually. Those clients who have a good upload bandwidth should be able to up-stream their video in the most high resolution as possible regarding their bandwidth. For those clients having a bad upload connection i assume to reduce their video resolution automatically. The aim behind this automatic bandwidth detection should be to give the most priority to the audio streaming by taking care to not overhelming the bandwidth with heavy camera usage.
    I know there is upload speed tests (onBWCheck, etc), but i assume this test is annoying for the participants as well as they are not reflecting dynamic changes.
    So lets say i start with a default camera resolution of 640 x 480 px for every client. What i need to know is in general two informtion in order to judge about the current bandwidth is enough for the currently up-streamed camera video:
    1) the actual bandwidth used for the up-streaming camera video (based on specific resolution, quality and fps) which is of course dynamicly changing
    2) the max. needed bandwidth which is necessary to perfectly up-stream the camera video regarding the specific resolution, quality and fps of the camera settings
    So here is my current solutions:
    1) the actual bandwidth: every second the currentBytesPerSecond() method of the NetStreamInfo object is of my uploading stream is called to get the currently used bandwidth speed (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStreamInfo .html#currentBytesPerSecond). The documentation says about the currentBytesPerSecond() method: Specifies the rate at which the NetStream buffer is filled in bytes per second. I understood from that phrase that literally this is the amount of bytes filled into the network depending on the current network situation. I tested this by using bandwidth limitation and in fact the currentBytesPerSecond() returns the dynamicly changed amount of bytes sent through the network. So thats pretty OK.
    2) the max. needed bandwidth: here i struggle. I have three principal ideas to know how much bytes/second are max. needed to up-stream the camera video to the server in a proper way:
    * either by experience, which means i manually make several tests to know the max. bytes/second needed for every possible specific resolution, quality, fps (i discovered that different cameras can even produce different results with the same camera settings!)
    * calculate the needed bytes/second (actually i use the H246 codec)
    * or finally the most crazy but maybe most proper solution: beside the up-stream to the server the client streams additionally to the same client application over the localhost network. I find this last attempt the most interesting because it gives very practicaly accurate result how much bytes must be send because almost the bandwidth of the network through the internet isnt used either. The client sends a stream to himself over the internal network IP (localhost, 127.0.0.1). To achieve this i tried to let the NetConnection being connected to localhost and null and publish the video. But the stream didnt worked. Here is my code:
              private function init():void {
                    nc = new NetConnection();
                    nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    nc.connect(null);
                    ns = new NetStream(nc);
                    ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ns.client = {};
                    var camera:Camera = Camera.getCamera();
                    if (camera) {
                        videoDisplay.attachCamera(camera);
                    } else {
                        Alert.show("You don't seem to have a camera.");
                    ns.attachCamera(camera);
                    ns.publish("streamname");
                    mainTimer.addEventListener (TimerEvent.TIMER, onMainTimerTickHandler);
                    mainTimer.start();
                private function onMainTimerTickHandler (evt:TimerEvent): void
                    info.text += Number(ns.info.currentBytesPerSecond / 1000).toFixed(2) + " kBytes (OUT)\n";
                private function netStatusHandler(event:NetStatusEvent):void {
                    info.text += event.info.code+"\n";
    The result is a connection success, but the stream didnt send any data due to the fact that ns.info.currentBytesPerSecond returns 0. Also strange is that the NetSteam or NetConnection didn't return any error.
    So folks here i struggle and i ask does anyone out there have any hints or ideas how to solve this tricky one?
    Thanks in advance,
    Markus

    Thanks,I have read that article.  Based on that article the NetStreamInfo.maxBytesPerSecond is not an accurate measurement to base dynamic switching on. This seems to be the basis of the bitrate switching in both the longtail player, and the adobe examples that I have tried.   That article suggests using the dropped frames property, in conjunciton with bufferlength to determine if switching is neccessary.  Unfortunately I can't seem to find a player online which handles this successfully.  That being said, I can't believe I'm the only person trying to implement dynamic bitrate switching for live streams so surely there are some players out there which can do this successfully?  If anyone knows of any code available which does this successfully I would appreciate knowing where!  The examples provided by Adobe https://www.adobe.com/cfusion/entitlement/index.cfm?e=fms35 unfortunately don't work either.

  • Long dynamic query not optimized ?

    I have a stored procedure that dynamically builds a query string and then executes it.
    I noticed that above certain number of WHERE conditions the query is much slower, even if the new conditions are always true (1=1).
    Details:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    procedure findStuff(
         p_a IN CHAR,
         p_b IN CHAR,
         p_c IN INTEGER,
         p_d IN SMALLINT,
         p_e IN VARCHAR2, -- and a few more parameters, omitted here...
         p_out out sys_refcursor)
    is
        sqlQuery VARCHAR2(2024);
    begin
         sqlQuery := 'select T1.* from T1 ' ||
                'where BAR1 = :c_false ';
         IF p_a IS NOT NULL THEN
              sqlQuery := sqlQuery || 'AND FOO_A=:p_a ';
         ELSE
              sqlQuery := sqlQuery || 'AND ((1=1) OR :p_a IS NULL) ';
         END IF;
         IF p_b IS NOT NULL THEN
              sqlQuery := sqlQuery || 'AND FOO_B=:p_b ';
         ELSE
              sqlQuery := sqlQuery || 'AND ((1=1) OR :p_b IS NULL) ';
         END IF;
         IF p_c IS NOT NULL THEN
              sqlQuery := sqlQuery || 'AND FOO_C=:p_c ';
         ELSE
              sqlQuery := sqlQuery || 'AND ((1=1) OR :p_c IS NULL) ';
         END IF;
    -- and a few more like that, for each input parameter...
    -- c_false is a constant, defined in the package body
                   OPEN p_out FOR sqlQuery USING c_false, p_a, p_b, p_c, p_d,...;
    end;The issue is, that this query takes about 0.34 seconds on my database, but if I remove two parameters (an IF block above) then it runs in 0.06 seconds.
    Even if the corresponding parameter has the values NULL (so in efect I just removed a "AND ((1=1) OR NULL IS NULL) ".
    Am I running into some limit here?
    What are my options, besides removing some rarely used parameters from the procedure?
    Is this some server setting (can it become an issue again later, even if I remove some conditions from the query) ?
    Regard,
    David

    xerces8 wrote:
    Am I running into some limit here?
    What are my options, besides removing some rarely used parameters from the procedure?How many parameters are we talking about here in reality?
    Either way you should check out the following: {message:id=9360003}
    Also the approach you are taking is a pre-11.2. You should probably adopt the new approach that uses DBMS_SQL.TO_REFCURSOR function. Here is an (untested) example:
    DECLARE
         l_cursor NUMBER := DBMS_SQL.OPEN_CURSOR;
         l_refcursor SYS_REFCURSOR;
         l_sql       VARCHAR2(250) := 'SELECT * FROM foo WHERE 1=1 ';
    BEGIN
         IF p_a IS NOT NULL THEN
              l_sql := l_sql || ' AND p_a = :b_a';
         END IF;
         IF p_b IS NOT NULL THEN
              l_sql := l_sql || ' AND p_b = :b_b';
         END IF;
         DBMS_SQL.PARSE(l_cursor, l_sql, DBMS_SQL.NATIVE);
         IF p_a IS NOT NULL THEN
              DBMS_SQL.BIND_VARIABLE(l_cursor,'b_a',p_a);
         END IF;
         IF p_b IS NOT NULL THEN
              DBMS_SQL.BIND_VARIABLE(l_cursor,'b_b',p_b);
         END IF;     
         DBMS_SQL.EXECUTE(l_cursor);
         l_refcursor := DBMS_SQL.TO_REFCURSOR(l_cursor);
    END;
    /Edited by: Centinul on Jul 12, 2011 8:01 AM

  • Dynamically changing size of JList items?

    Hello!
    I'm working on an application which kind of revolves around a JList with a custom ListCellRenderer. Now, it all works rather good as it is, but I want the selected JList item to show more detailed information about the selected value, and thus I need it to be bigger then the not selected items. The thing is that no matter what I do I can't seem to make the JList adopt to the new size of the selected item, which results in only half of the stuff in the selected item being shown.
    Is there any way to do this it would be great! (I bet there is some really simple way which I have simply overlooked.)
    And, fyi: The component returned by getListCellRendererComponent is a JPanel which consists of three JLabels using a GridLayout. The selected component is generally the same, but with an extra row in the GridLayout.
    Any help/suggestions will be greatly appreceated!
    Yours, Jiddo.

    I have tried with a couple of different layout managers, and none of them (except for this one) seems to offer me the layout I need. Also, I have tried making it return different instances depending on if it is selected or not. The non-selected one has only one row in the layout while the selected has two. Here is a screenshot of how it looks:
    http://img211.imageshack.us/img211/2779/jlistes1.jpg
    Yours, Jiddo.

  • Dynamic content in JList renderer

    Hi all
    I've got a gui with a JList with rather complex content. I render that content with a custom ListCellRenderer that uses a JPanel. This works perfectly well for "non animated" things like text, JLabels etc.
    Now I want to add to these panels in that JList a JProgressBar in "indeterminated" state (that is constantly sliding back and forth). The proglem is that the whole JList only does a repaint when the JList itself needs to do so (when resizing the window for example) and not when that Jprogressbar wants to repaint (in only gets rendered once)
    Can I solve this, or will I have to implement my own JList-like panel.. That would mean I also have to implement the whole "selection" thing, which was why I choose JList in the first place.
    thanks in advance

    camickr suggested a way to solution. Notifying list of its contents change is the way to present change to the user, for example ProgressBar change. You could not to use Timer and instead notify your list immediately its item have changed.
    For a perfomance you could not to re-create your Renderer instance for each item but save it and reuse. The renderer will be repainter either way.
    Denis Krukovsky
    http://sourceforge.net/projects/dotuseful/

  • Query in Optimal Coding - Assigning INT TAB to FIELD SYMBOLS dynamically.

    TABLES: tkesk.
    DATA: itkesk type table of tkesk.
    DATA: BEGIN of itab_RP occurs 11,
    tabname type string,
    END of itab_RP.
    DATA : wa_rp like line of itab_Rp,
    wa_onemore like line of itkesk.
    FIELD-SYMBOLS: <fs> LIKE itkesk.
    ITAB_RP-tabname = 'ITKESK'.
    APPEND ITAB_RP.
    LOOP at ITAB_RP into wa_rp.
    <i><b>*How to assign the table itkesk to the field symbol
    *which is available in wa_rp dynamically instead of assigning it directly)</b></i>
    *ASSIGN wa_rp-tabname to <fs>.
    ASSIGN itkesk to <fs>.
       LOOP at <fs> into wa_onemore.
       WRITE : 'hi'.
       endloop.
    ENDLOOP.

    Is this even possible ?
    Thanks
    Mark

  • Optimizing rendering speed in dynamic form (subforms)

    Hi
    I have a form with 4 pages. Each page has 2-4 subforms. I am looking for info on how you can optimize the speed of showing/hiding subforms.
    In my form the user clicks a checkbox and I show a hidden subform. The Subform takes 3-5 secs. to show - that is too much considering reader is running the form locally.
    My page1 has a layout with a lot of static text, fields and linies etc. If I delete this section the speed improves to about 1 sec. I know how to merge static texts but often it makes it unflexible to edit them later.
    Any great ideas on how to make dynamic layout i big forms (with lots of contents) AND still be able to show/hide subforms at a acceptable speed??
    ** I hope Adobe will improve the preformance in comming versions cause dynamic forms serve no improvement in user interaction when so slow!
    /Thomas Groenbaek
    Denmark

    This happens when you use a global binding and set the parent container to repeat for each data item.
    For more detailed answer I need to see your form.

  • Dynamically growing JList

    I have created a JList which grows according to information received over a serial port, but can't figure out how to make the JList (contained in JScrollPane) show the last element that has been added.
    I have set JList.setVisibleRowCount(5), so that a scroll bar appears in the JScrollPane when the size of the list goes over 5, but can't get it to scroll down and show the last element in the list.
    Anybody know how I could do this?
    Thanks, Nick.
    PS: using JList.setSelectedIndex(index) doesn't work. It just selects the item, but doesn't center on that item.

    Doesn't matter how many times you look through the API, you never see the method that you need...
    Thanks, Nick.

Maybe you are looking for

  • Error Launching Web Analysis Report from the Hyperion Workspace

    Hi Everyone When launching the report as a HTML from the Workspace, the output flashes briefly on screen The view in the content pane disappears to leave a blank screen. When I Select View | Refresh. The following result is returned "Web Analysis Inf

  • Sql Query (updateable Report) returning ORA-06502: PL/SQL: numeric or value

    Hi I have a Sql Query Report Region as defined below. On the report attributes I am not using any "Row Selector". In a After submit process I try to print out the results of the value I have entered in as a value in updatable report and i get the err

  • Cannot create A/R Invoice from Delivery

    Hi everyone. I have a Delivery based on a Sales Order and want to make an A/R Invoice from the Delivery using the "Copy to" button on the Delivery form. When I do that I get the following message: "One or more down payment that are linked to the base

  • PO amount isn't reflected in the liquidity forecast

    Dear Gurus, I have completed all the cash management configuration, but somehow the liquidity forecast only captures the balance of PO that has been converted to invoice through MIRO. I think CM retrieves the invoice balance through planning group wh

  • Error Clearing Customer

    Dear All , I am trying to clear with using F-32 for a customer  (open items only with special GL indicator A ) I got the below error . Do you have any idea wht i got this error ? Multiple special G/L indicators not permitted Message no. ICC_TR194 Dia