Hi All,
I have a JFrame which contains a JList Object. I initialize the JList object normally using:
urlList = new javax.swing.JList(barstools);
However, I want to be able to add to the JList and Remove from it. There is an actionListener for a menubar item that deletes all the items from the JList:
JMenuItem newSelect=new JMenuItem("New List"
newSelect.setMnemonic('N');
newSelect.setToolTipText("Create a New URL List"
newSelect.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e)
{
System.out.println("4"
urlList.removeAll();
urlList.updateUI();
repaint();
}
}
);
menu.add(newSelect);
However, the GUI will not refresh. Does anybody have some ideas?
thanks
Brinker
I have a JFrame which contains a JList Object. I initialize the JList object normally using:
urlList = new javax.swing.JList(barstools);
However, I want to be able to add to the JList and Remove from it. There is an actionListener for a menubar item that deletes all the items from the JList:
JMenuItem newSelect=new JMenuItem("New List"
newSelect.setMnemonic('N');
newSelect.setToolTipText("Create a New URL List"
newSelect.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e)
{
System.out.println("4"
urlList.removeAll();
urlList.updateUI();
repaint();
}
}
);
menu.add(newSelect);
However, the GUI will not refresh. Does anybody have some ideas?
thanks
Brinker