View Single Post
Old 08-17-2012, 10:20 AM   PM User | #1
jordandap
New Coder

 
Join Date: Jul 2011
Posts: 44
Thanks: 5
Thanked 0 Times in 0 Posts
jordandap is an unknown quantity at this point
repopulating JLists?

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);
}
jordandap is offline   Reply With Quote