JList clearSelection() problems

Hi, i am having problems clearing a selection. I am using the default selection model, how do i possibly notify the listeners if the fireValueChanged() method is protected? Sorry new ish to java really stuck. Iv tried putting my class implementing implements ListSelectionListener, ActionListener so that i can use the protected method, but still i get a cant find symbol error on it. Tried this in many forms and still no joy. Any ideas? Thanks! Dan

I don't understand your question. You just invoke the clearSelection() method on the JList. You don't need to fire any event or anything.
If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", that demonstrates the incorrect behaviour.
http://homepage1.nifty.com/algafield/sscce.html
Don't forget to use the "Code Formatting Tags", so the posted code retains its original formatting.
http://forum.java.sun.com/help.jspa?sec=formatting

Similar Messages

  • JList selection problems

    I'm having problems with JList selection - it's really wierd.
    I have a Jlist and on different selections I want to do stuff - well, I do see the GUI line get highlighted but everytime my ListSelectionListener is called the selected index stays 0.
    also, it always calls the ListSelectionListener twice for every selection I make.
    here's how my code looks:
    (typesList is my JList)
    typesList.setSelectedIndex(0);
    typesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    typesList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
          public void valueChanged(ListSelectionEvent e) {       
            int newSelection = typesList.getSelectedIndex(); //this returns always 0!        ...
          }

    Look at the line getValueIsAdjusting... (only one selection is processed. And, this code works and provides proper index.
        * Method to load all Tables from Database user
        public void loadTables() {
            // run Database request
            tableListModel = getListModelData("select object_name from user_objects where object_type = 'TABLE'");
            // now plug List with Model
            tableList = new JList(tableListModel);
            tableList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            tableList.setSelectedIndex(0);
            //tableList.addListSelectionListener(this);
            tableList.addListSelectionListener(
                new ListSelectionListener() {
                    public void valueChanged( ListSelectionEvent e )
                        if(e.getValueIsAdjusting()) return;
                        String tablename = tableList.getSelectedValue().toString();
                        showColumnData(tablename);
                        displayAllTableData(tablename); //intensive (reworking)
            jScrollPane1.add(tableList);
            jScrollPane1.setViewportView(tableList);
            showColumnData(tableList.getSelectedValue().toString());
        }PiratePete
    http://www.piratepetesoftware.com

  • JList item problem

    Hello Coders
    I have question regarding to Jlist.
    To capturing event i use this code :
    class roomListener implements ListSelectionListener{
        public void valueChanged(ListSelectionEvent e) {
        int x=0;
        System.out.prinln("the roomListener invoked for=>"+ x++);
          if (e.getValueIsAdjusting() == false) {
            if (roomList.getSelectedIndex() == -1) { // if no selection
              p("roomList is no selection");
            }else {// selection made
              currRoom = roomList.getSelectedValue().toString();//get the nickFromList
              roomLabel.setText("Your currRoom is=>"+currRoom);
              // request charom
              ClientRequester.sendChanghRoom(shortName,currRoom);
      }the output is :
    the roomListener invoked for=>0
    (i want to response to every single click on the same item)
    The problem is :
    When I click on item I see that valueChanghed() invoked , but when I prees again and again on the same item valueChanghed() not invoked anymore , why?
    Thanks

    hi,
    pretty clear, isn't it? valueChanged() is only invoked when the selection value CHANGED. If you click on the selected item again and again, the selection doesn't change. I suggest attaching a mouse listener to the list instead.
    best regards

  • Printing JList - font problems

    i am using a class that takes a Component and prints it.
    in windows:
    when i send a JList, it prints using the standard java font. if i set the LookAndFeel to the DefaultOS, then if i set font that is what I am assuming to be the System default (in windows this seems to be "sansserrif" size 11).
    in mac os:
    when i try to print the JList it spits out a different font and much larger font size, so it's throwing off my usable print area. i tried setting the font of the JList to the "sansserrif" but it had no effect....it's still printing using the default mac font. i had my gui show me the jlist...it looks identical to how it looked in windows....until i print. method used: jList.setFont(new Font("sansserif", Font.PLAIN, 11));how do i override this with my own font? and why would it let me override it in windows? seems fishy to me... (i hope i was somewhat clear...i think im confusing even myself at this point)

    in case anyone was interested...i was able to get cross-platform printing to work "good enough." although not identical, these two variations produced nearly the same result (the only difference was that the cell heights weren't quite the same... i think 10.5 for the mac version would match 14 for windows perfectly, but only integers are accepted as parameters for the setFixedCellHeight() method).
    i also had to fix the print graphics translation to set a 1" top, left margin in stone...the mac os wanted the margin to be just a fraction of an inch.
    //for 8.5" x 11" pages:
    jList = new JList(theModel);
        jList.setLayoutOrientation(JList.VERTICAL_WRAP);
        jList.setVisibleRowCount(-1);
        if (windows)
          jList.setFont(new Font("sansserif", Font.PLAIN, 11));
          jList.setPreferredSize(new Dimension(620,860));
          jList.setFixedCellHeight(14);
          jList.setFixedCellWidth(210);
        else //mac
          jList.setFont(new Font("sansserif", Font.PLAIN, 8));
          jList.setSize(new Dimension(470,673));
          jList.setFixedCellHeight(11);
          jList.setFixedCellWidth(155);
        }again, this was sending a 3-column JList as a component to a printing function.

  • JList -ListCellRender- problems

    I have a jList and I want to make some of the jList component Bold and other not ==or with other color==.
    I've tried with ListCellRenderer but is not working, or I don't know how to use it. Please tell me more.
    If you can please send me an example.
    Thanks.

    First, here's a ListCellRenderer from the program I'm working on:
    public class TaxonomicLevelListRenderer extends JLabel implements ListCellRenderer {
      public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
      setText(value.toString());
      setFont(BNBUtil.plainFont);
      if (isSelected)
        setForeground(Color.red);
      else
        setForeground(Color.black);
      return this;
    }and here's how I use it:
    JList levels = new JList();
    levels.setCellRenderer(new TaxonomicLevelListRenderer());

  • JList, and problem related

    I use DefaulListModel to insert data into JList:
    DefaultListModel model =new DefaultListModel();
    model.addElement("item1");
    model.addElement("item2");
    JList list=new JList(model);
    but i use method: list.getSelectedvalue();
    result value is always null.
    please, help me

    duplicate post
    http://forum.java.sun.com/thread.jspa?messageID=4317841

  • JList customize Problem (MouseOver on JList)

    Hi, I tried to customise JList.
    Using CellRenderer, I tried to make JList listen MouseEntered and
    MouseExited Event in order to perform mouse over effect.
    But, Nothing worked. It seems Renderer doesn't get Mouse Event.
    Please response if it is possible to put Mouse over effect on JList,
    or it's not possible?

    I used a MouseMotionListener to do what I think you want:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class TestList extends JFrame implements ListSelectionListener
         JList list;
         public TestList()
              //  this will create a mutable list
              DefaultListModel listModel = new DefaultListModel();
              listModel.addElement("one");
              listModel.addElement("two");
              listModel.addElement("three");
              listModel.addElement("four");
              listModel.addElement("five");
              listModel.addElement("six");
              list = new JList( listModel );
              list.setVisibleRowCount(5);
              getContentPane().add( new JScrollPane(list) );
              list.addListSelectionListener( this );
              list.setCellRenderer( new MyCellRenderer() );
              list.addMouseMotionListener( new MouseMotionAdapter()
                   public void mouseMoved(MouseEvent e)
                        int row = list.locationToIndex( e.getPoint() );
                        list.setSelectedIndex(row);
         public void valueChanged(ListSelectionEvent e)
              if (e.getValueIsAdjusting())
                   return;
              JList list = (JList)e.getSource();
              System.out.println( list.getSelectedValue() );
         public static void main(String[] args)
              JFrame frame = new TestList();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible( true );
         class MyCellRenderer extends JLabel implements ListCellRenderer
              public MyCellRenderer()
                   setOpaque( true );
              public Component getListCellRendererComponent(JList list,
                                       Object value,
                                       int index,
                                       boolean isSelected,
                                       boolean cellHasFocus)
                   setText(value.toString());
                   setFont(list.getFont());
                   if (isSelected)
                        setBackground(list.getSelectionBackground());
                        setForeground(list.getSelectionForeground());
                    else
                        setBackground(index % 2 == 0 ? Color.white : Color.lightGray);
                           setForeground(list.getForeground());
                   return this;
    }

  • Listing files of a specific format in a JList

    I am using the following code to list the file in a directory in a JList, the problem is that I only want files of a specific format to be listed. Is there any way to do this?
    public static void listfile() {
         File[] files = directory.listFiles();
         Arrays.sort(files);
         list.setListData(files);
    }

    Horrible pseudocode is right.
    Use a FileNameFilter and learn to read the API so you
    don't have to ask dumb questions again.I appreciate youre trying to help, but calling my question stupid is illogical concidering that the java forums are for all questions with relevence to Java and not just the ones you don't find to stupid. Fortunatly I don't hold a grudge and I don't have a death-ray at my disposal right now ;-)

  • JSplitPane problems : how to set the size of one component to be constant?

    I have a horizontal JSplitPane, the left side of which is occupied by a JTextArea and the right side by a JPanel, which will later contain a JList.
    my problem is:
    when resize I resize the window:
    1. on expanding: the right side of the JSplitPane increases in size ( hence the JPanel increases in size ), while the JTextarea remains the same.
    2. on contracting: the JTextArea keeps becoming smaller and until it nearly vanishes, and then the JPanel starts contracting.
    It does not matter what corner or what size of the JFrame I use to resize it: the result is the same.
    what do i do to reverse the effect but with the following difference:
    On resizing, the following happens:
    1. on expanding: the size of the JPanel remains the same, and the JTextArea keeps getting bigger
    2. on contracting: the size of the JTextArea remains the same, and the JPanel contracts UNTIL IT REACHES A MINIMUM WIDTH. After this width, the JTextArea starts contracting, UNTIL THIS TOO REACHES A MINIMUM SIZE (both height and width). After this limit, no more contraction is possible.
    My code is:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    class MultiEditClient extends JFrame
         public MultiEditClient( String title )
              super(title);
              addComponents();
              addMenu();
         protected void addComponents()
              this.setBounds( 100,100,      500,500 );
              JPanel panel = new JPanel();
              JLabel label = new JLabel( "The to-be status bar." );
              label.setFont( new Font( Font.SANS_SERIF , Font.PLAIN , 14 ) );
              label.setMinimumSize( label.getMaximumSize() );
              JTextArea textarea = new JTextArea();
              textarea.setPreferredSize( new Dimension(400,400) );
              textarea.setMinimumSize( textarea.getMaximumSize() );
              JScrollPane scrollForTextArea = new JScrollPane(textarea);
              JPanel anotherpanel = new JPanel();
              anotherpanel.add( new JButton("Sample Button") );
              JSplitPane splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, scrollForTextArea, anotherpanel );
              splitPane.setOneTouchExpandable(true);
              panel.setLayout( new BoxLayout(panel, BoxLayout.PAGE_AXIS ) );
              Box vBox = Box.createVerticalBox();
              Box hBox2 = Box.createHorizontalBox();
              hBox2.add( splitPane );
              vBox.add( hBox2 );
              vBox.add( Box.createVerticalStrut(5) );
              Box hBox = Box.createHorizontalBox();
              hBox.add( Box.createHorizontalStrut(5) );
              hBox.add( label );
              hBox.add( Box.createHorizontalGlue() );
              vBox.add( hBox );
              vBox.add( Box.createVerticalStrut(2) );
              panel.add( vBox );
              add( panel );
         protected void addMenu()
              JMenuBar menubar = new JMenuBar();
              JMenu session = new JMenu( "Session" );
              JMenuItem joinSession = new JMenuItem( "Join Session" );
              session.add( joinSession );
              menubar.add( session );
              this.setJMenuBar( menubar );
         public static void main( String args[] )
              MultiEditClient theFrame = new MultiEditClient( "MultiEdit Client" );
              theFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              theFrame.pack();
              theFrame.setVisible( true );
    }

    okay...
    I have a JFrame, that contains a JSplitPane with the splitter placed vertically so that it has a left side and a right side.
    In the left side a JTextArea is placed. In the right side a JPanel is placed, whic h will also contain a JList later.
    When I resize the frame along the height of the JFrame, the height of both the components (JTextArea and JPanel) increases - quite natural, no problems here.
    But when I resize the frame along the width I see the following behaviour:
    1. on expanding: the JTextArea retains its width, and the JPanel increases in width.
    2. on contracting: the JTextArea retains its width, and the JPanel contracts.
    after contracting to its minimum width, the JTextArea starts contracting.
    Desired behaviour: the JPanel maintains its width, no matter what. I only what the JTextArea to change in width.
    And after the JTextArea reaches a minimum width, the frame contracts no more ( this i can do by setting the frame's min size ).
    I hope I am more clear and less confusing this time :)
    thanks

  • Help get rid of nagging JList UI exception

    Does anyone have an idea how to get rid of this nagging exception? By the way, my program continues to run just fine even when it's thrown. I suspect it's thrown because the JList UI is updated while the Listener event is fired...
    But I just cannot figure out a work-around for this.
    So, the culprit code snippet is:
    -----------start code-------------------
    oldlist.addListSelectionListener(new ListSelectionListener() {           
    public void valueChanged(ListSelectionEvent e) {
    if(e.getValueIsAdjusting()){
    Object selectedValue = oldlist.getSelectedValue();
    newlistdata.add(selectedValue);
    newlist.setListData(newlistdata);
    newlist.updateUI();
    //How to get rid of this nagging UI exception?
    oldlistdata.remove(selectedValue);
    oldlist.setListData(oldlistdata); // EXCEPTION THROWN HERE!
    oldlist.updateUI();
    ------------end code------------------
    And the stack trace is:
    Optimization completed successfully.
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1312)
    at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1292)
    at javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(BasicListUI.java:2605)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:147)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:194)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:388)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:398)
    at javax.swing.DefaultListSelectionModel.removeSelectionIntervalImpl(DefaultListSelectionModel.java:559)
    at javax.swing.DefaultListSelectionModel.clearSelection(DefaultListSelectionModel.java:403)
    at javax.swing.JList.clearSelection(JList.java:2013)
    at javax.swing.JList.setModel(JList.java:1646)
    at javax.swing.JList.setListData(JList.java:1687)
    at panorama2flashtools.Main$1.valueChanged(Main.java:215)
    at javax.swing.JList.fireSelectionValueChanged(JList.java:1765)
    at javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1779)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:147)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:194)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:388)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:398)
    at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:442)
    at javax.swing.JList.setSelectionInterval(JList.java:2035)
    at javax.swing.plaf.basic.BasicListUI$Handler.adjustSelection(BasicListUI.java:2721)
    at javax.swing.plaf.basic.BasicListUI$Handler.mousePressed(BasicListUI.java:2677)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:263)
    at java.awt.Component.processMouseEvent(Component.java:6035)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:5803)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4410)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3983)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2429)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    BUILD SUCCESSFUL (total time: 35 seconds)
    Thanks!

    jaarik wrote:
    I suspect it's thrown because the JList UI is updated while the Listener event is fired...Quite likely. Are you executing that code in the event thread (the Swing thread) or in some other thread? If the latter, or if the answer is "Huh?" then read the Swing threading tutorial.
    And by the way, there's a Swing forum (scroll down a bit) which is inhabited by people who know Swing a lot better than I do.

  • Remove Selection from jList ??

    Hi,
    How do I remove a Selection from a jList??
    The items in the jList are Vectors
    I now use jList.clearSelection() but the selection stays there..
    Thanks,
    Marie

    Funny you should ask. I just now decided to try out what I suggested because I've never actually used a Vector in a JList. In my simple example below, I actually have to call repaint on the list to get it to refresh. I should NOT have to do that. Might be a bug in the VM?Please try it out on your machine and see if you can remove the 'repaint' statement in my action listener and get the list to refresh.
    I use 1.4.1_02 JDK. Let me know also which JDK you're using. Thanks!
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.BorderLayout;
    import java.util.Vector;
    public class MyList extends JFrame {
         Vector model = new Vector();
         public MyList() {
              super();
              setSize(300,400);
              getContentPane().setLayout(new BorderLayout());
              buildModel();
              final JList list = new JList(model);
              getContentPane().add(list, BorderLayout.CENTER);
              JButton btn = new JButton("remove");
              btn.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        model.remove(list.getSelectedIndex());
                        list.repaint(); //why should I have to force a repaint???
              getContentPane().add(btn, BorderLayout.NORTH);
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              show();
         private void buildModel() {
              model.add("one");
              model.add("two");
              model.add("three");
         public static void main(String[] args) {
              new MyList();

  • JList error

    Hi, I am really stucked :(
    I have panel with JList inside. It has default data model.
    Then when program runs, listener adds items into the JList. Problem is - sometimes happens that when e.g. two items should be added only the first appears and the panel with JList seems to be "frozen". Can't click, can't select items.... Only thing (known for me) that helps is to call updateUI() on the JList. After that everything is ok, functional, all items appears... Repaint nor update do not help... I thought that "rough" solution is to call updateUI right after each item is added - but then occurs some null pointer in the JList component during the run...
    Guys, does anybody help me?
    Thanks Milan

    Yeah, I do it like this:
    DefaultListModel model = (DefaultListModel)list.getModel();
    model.addElement(item);
    But it seems that helped placing
    list.validate()
    list.repaintImmediately()
    on the right place..
    Thanks

  • How to make JComboBoxes transparent

    For some reason "setOpaque(false)" doesn't seem to work for JComboBoxes. I'm using java 1.4
    Below is some code. If you compile and run it you should get a window with a button and a combo box, the button is transparent, the combo box is not.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.geom.Area;
    * test transparent swing components
    class TransTest
    public static void main(String args[])
         JFrame theFrame = new JFrame("transparency test");
         JComponent contentPane = new JComponent()
              public void paint(Graphics g)
              Graphics2D g2 = (Graphics2D)g;
              Area s = new Area((Shape)new Rectangle(0, 0, getWidth(), getHeight()));
              g2.setPaint(new GradientPaint(0f, 0f, Color.GRAY, 150f, 100f, Color.WHITE, true));
              g2.fill(s);
              super.paintChildren(g);
         theFrame.setContentPane(contentPane);
         theFrame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
         JButton button = new JButton("button");
         button.setOpaque(false);          // this works
         JComboBox combo = new JComboBox();
         combo.addItem("combo");
         combo.setOpaque(false);               // this doesn't seem to work
         JPanel pnl = new JPanel();
         pnl.setOpaque(false);
         pnl.add(button);
         pnl.add(combo);
         contentPane.setLayout(new BorderLayout());
         contentPane.add(pnl, BorderLayout.CENTER);
         theFrame.pack();
         theFrame.setVisible(true);

    Try setOpaque(true) and setBackground(new Color(r,g,b,a)) where r, g and b are respectively the values of red, green and blue and a the alpha value (0 means totaly transparent, 255 totaly opaque). Sometimes a component should be opaque with a transparent background to make the transcparency works.
    But I have to ask you a question : have you bugs with the display ? Indeed, I made an app that doesn't use a gradient paint like you, but the JFrame have a ContentPane that display a picture. I made every JComponent transparent in order to see the background picture. The display is very dirty with JButton, JTextArea, JTextField and JList. Indeed, when moving cursor over JButton, the JButton displays the top lecft corner of the JFrame instead of the underlaying part of the picture as expected with transparency. With JTextField and JTextArea, when typing text the same problem occured. With JList, the problem appear when scrolling. only a full update(Graphics g) can clean the display, that is I must call it with every mouseMoved, mouseClicked, etc. events. The problem appears only with JDK > 1.2.2 (JDK1.3 and later)

  • How to use Box.glue

    i have a java app using Swing JList
    the problem is that when the person resizes or gridbaglayout interprets the sign in such a way the list expands and covers up the button below it. i don't want the JList to expand and cover up the JButton that was below it. So i'm under the impression I need a glue to keep it in place.
    could someone give some guidance on that
    thanks in advance
    stev

    I am not a fan of Grid Bag Layout. ....It might be Basically Becos u have Kept Both JList and Button in the Same Cell...Try Placing them in Different Cells....Otherwise Use a Combination of BorderLayout and Flaw Layour...That shuld Solve ur Problem
    Cheers,
    Manja

  • JTabbedPane repainting issue

    when i repaint a panel that has a tabbedPane the components from other tabs bleed through the selected one, which is indice 0
    I have a JFrame borderlayout like this
    Container c = frame.getContentPane();
    c.add("West", jList);
    c.add("Center", panel);
    the panel is borderlayout as well like this
    panel.add("North", panel2);
    panel.add("Center", tabbedPane);
    the jList has about 10 items all of which need to remove and repaint panel depending on the selected item in list.
    so I do this:
    in a valueChanged method cause i implement ListSelectionListener
    int index = jList.getSelectedIndex();
    if(index == -1) return;
    c.remove(panel);
    if(index == 0) c.add("Center", new SomeClass());
    else if(index == 1) c.add("Center", new SomeClass2());
    else if(.....) ect....
    // then i do this
    c.invalidate();
    c.validate();
    c.update(c.getGraphics());
    seems to work and i get matching content to list selection, and all components are visible. but compoenets from tabs underneath the currently selected one bleed through. when i click on one of the other tabs, and click back to the first one, the problem is gone. if i choose something else from the jList, the problem starts all over again.

    found the issue - nevermind
    seems like I had old references to objects originally displayed on the panels that sat on TabbedPane
    so when i went tried to bring back an item in jList, i had a mess of old components lingering around.

Maybe you are looking for

  • Archiving pdf-document in external store ?

    hi there, i have a projekt, where i have to archive pdf-files on a external archive (ixos). i use the FM 'ARCHIV_CREATE_SYNCHRON_META' to archive the pdf-files. the big problem is the following: the name of the original pdf-file is not saved. there i

  • Trouble with a csv datasource in the repository

    Hello, I'm running 10.1.3.4 on Red Hat Linux. I placed a test .csv file on the BI Server, and am trying to get to the data using the BI Administrator tool. When I imported the .csv file into the repository, it appeared to work. In the physical layer,

  • Cannot renew credits in Taiwan

    I am having the same problem! I have had my account for almost 10 years now, long before PCHome, so why can't i do a simple renew??? I would understand if this was presented BEFORE I had setup all my business accounts. Now I'm faced with trying to de

  • Passing variables from DM to logic script problem (REPLACEPARAM)

    Dear All, I would like to send variables from data manager to a logic script. The script copies values from an account to an other. If I hardcode two accounts in the script, it works fine, but I want to pass these two accounts dynamically from data m

  • Can't install CS4 on Win 7

    I keep getting this error when running installer on the computer. Any suggestion how to remove this error: I have Win 7, 32 bit on this machine. Product: Adobe Setup -- Error 1935.An error occurred during the installation of assembly 'Microsoft.VC80.