why isn't my combobox appearing on my frame?
Hi all,
I have the following (simple) code so far for my JFrame.
Code:
import javax.swing.*;
import java.awt.FlowLayout;
/**
*
* @author mjohnson
*/
class ProjectConversions extends JFrame{
public ProjectConversions(){
setTitle("PS-Clarity Project Conversions Interface");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(300,300);
JComboBox entity = new JComboBox();
EntityProvider comboFill = new EntityProvider();
//Fill JComboBox with values retrieved from EntityProvider Class
for(String name :comboFill.fileArray){
entity.add(name, this);
}
entity.setVisible(true); //set combobox to visible
setVisible(true); //set frame to visible
}
}
Code:
I am using a different class with a main method calling this frame:
public class ProjectConverstionMain {
public static void main(String args[]){
new ProjectConversions();
}
}
The combo box is being populated from an ArrayList in another class but it is not visible when I run the main method.
I can see the JFrame with the title I have set - but no ComboBox..
any ideas?
thanks in advance,
Matt