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

List's selected item gets truncated when added to FlowPanel

XMLWordPrintable

    • x86
    • windows_xp

      When selecting the longest item in a List, it gets truncated showing '..' at the end. Reproducible with 13th April build. To reproduce, run the code below. Select any item from List, it gets truncated.

      import javafx.gui.*;

      Frame {
          content: FlowPanel {
              content: List {
                  items: for (i in [1..9]) { ListItem { text: "Item{i}" } }
              }
          }
          width: 200
          height: 200
          visible: true
      };
      Reproducible only on 6u10 (checked with b14 and b21) with swing on Windows XP. Not reproducible on 6u3 and jdk7 (checked with b25).

      import java.awt.FlowLayout;
      import javax.swing.JFrame;
      import javax.swing.JList;
      import javax.swing.JScrollPane;

      public class ListTest {

          public static void main(String[] args) {
              JFrame f = new JFrame();
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f.setSize(200, 200);
              
              String[] items = new String[5];
              for (int i = 0; i < 5; i++) {
                  items[i] = "Item" + i;
              }
              JList list = new JList(items);
              
              f.getContentPane().setLayout(new FlowLayout());
              f.getContentPane().add(new JScrollPane(list));
              f.setVisible(true);
          }
      }
      This is a regression from 6u10 b12 onwards. Checked with 6u10 b11, it's working fine.

            rbair Richard Bair (Inactive)
            gramachasunw Girish Ramachandran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: