Hello I am making a program that auto clears and then repopulates a JList depending on what you have done.
I have managed to clear all the entries in the JList but can't seem to add any
Code:
private static ConstantsS[] = {};
private static VariablesS[] = {};
private void VarConUpdate()
{
ConstantsList.removeAll();
VariablesList.removeAll();
//what i want to do is put all of the VariableS[] in VariablesList
//and all ConstantsS[] ConstantsList
//how would I achieve this?
}
public GUIOutput()
{
JScrollPane ScrollPaneConstants = new JScrollPane();
ScrollPaneConstants.setBounds(636, 30, 126, 320);
getContentPane().add(ScrollPaneConstants);
ConstantsList = new JList();
ScrollPaneConstants.setViewportView(ConstantsList);
ConstantsList.setVisibleRowCount(5);
}