Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Ella Campbell   on Mar 04 In Java Category.

  
Question Answered By: Bathilda Schmidt   on Mar 04

I emailed IntelliJ support and got the solution. I was using the
following:

Vector fileList = new Vector(Arrays.asList(original.list()));
fileList.retainAll(Arrays.asList(translated.list()));
fileList.trimToSize();
listAdded = new JList(fileList);
this.getContentPane().setLayout(new FlowLayout());
this.getContentPane().add(this.listAdded);

There was no need to initialise the JList as its done already in the
GUI designer so the code  should have been,

Vector fileList = new Vector(Arrays.asList(original.list()));
fileList.retainAll(Arrays.asList(translated.list()));
fileList.trimToSize();
listAdded.setListData(fileList);

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Swing problem displaying JList elements in IntelliJ Or get search suggestion and latest updates.


Tagged: