BorderLayout problem
Hello.
I want to add to my BorderLayout two things:
1) JTable
2) JToolBar
but I have problems with them, i can't do it to work them both in the same time. When i have got JTable I don't have JToolBar. What could be wrong?
Some code of layout:
pane.add(table, BorderLayout.NORTH);
pane.add(toolBar,BorderLayout.South);
I've tried many different BorderLayout but they don't work. I think the problem is something different.
Ok. My mistake i didn;t saw some mistake in code but i fix it. Problem was in Layout, but now I have another problem with JTable
I code JTable like this:
public SimpleTableDemo(){
super(new GridLayout(1,0));
String[] columnNames ={"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
Object[][] data ={
{"Mary","Campione",
"Snowboarding",new Integer(5),new Boolean(false)},
{"Alison","Huml",
"Rowing",new Integer(3),new Boolean(true)},
{"Kathy","Walrath",
"Knitting",new Integer(2),new Boolean(false)},
{"Sharon","Zakhour",
"Speed reading",new Integer(20),new Boolean(true)},
{"Philip","Milne",
"Pool",new Integer(10),new Boolean(false)}
};
final JTable table =new JTable(data, columnNames);
but i don't have columnNames. They don't apper in my table.
Message was edited by:
Lukasz_1981
Message was edited by:
Lukasz_1981

