Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6215084

JList - HORIZONTAL_WRAP without data does not show up

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: orion3
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Understanding:
      Cause Known
    • CPU:
      sparc
    • OS:
      solaris_9

      Description

      Attached is the code to reproduce the problem. When the list has no data, the list is not shown on screen. When i create the list with some data then it shows up


      public class ListTest {
          public static void main(String[] args) {
              JFrame fr = new JFrame("ListTest");
              final JList list = new JList();
              list.setModel(new DefaultListModel());
              list.setVisibleRowCount(1);
              list.setLayoutOrientation(JList.HORIZONTAL_WRAP);
              JButton b = new JButton("Add");
               fr.getContentPane().add(b);
               JScrollPane pane = new JScrollPane(
                  JScrollPane.VERTICAL_SCROLLBAR_NEVER,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
              pane.setViewportView(list);
              fr.getContentPane().add(pane,"South");
              fr.setSize(600,180);
              fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              fr.setVisible(true);
          }
          
      }
      ###@###.### 2005-1-07 09:23:51 GMT

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: