my prog uses a frame and a panel, which are created once in a loop. The frame gets created and displayed as normal, but for some reason the panel is not created and/or it is not displayed.
any thoughts.
cheers.
class GUIThread extends Thread
{
public boolean threadClose;
public GUIThread()
{
SwingUtilities.invokeLater(this);
}
@Override
public void run()
{
JFrame lFrame = null;
JPanel lPanel = null;
boolean lFrameFlag = false;
threadClose = false;
while( !threadClose )
{
if(lFrameFlag == false)
{
lPanel = new JPanel();
lPanel.setSize(580,356);
lPanel.setLocation(10,10);
lPanel.setVisible(true);
lPanel.setBorder( BorderFactory.createLineBorder(Color.BLACK) );
lFrame = new JFrame();
lFrame.setSize(600,400);
lFrame.setLocation(200,200);
lFrame.add(lPanel);
lFrame.setVisible(true);
lFrameFlag = true;
}
}
}
}
public class GUITestHarness
{
public static void main(String[] args)
{
GUIThread lGUIThread = new GUIThread();
}
}
when running the frame is displayed, but the panel is not.