When I run the code , none of the components, neither the JTable or the buttons will show up inside the tab, they appear on the side of the tab window instead. any reason why that is ?
public void GUIcode() {
setLayout(new GridBagLayout());
setBounds(100, 100, 450, 300);
panel = new JPanel();
panel.setBorder(new EmptyBorder(10, 10, 10, 10));
setContentPane(panel);
panel.setLayout(null);
JTabbedPane tabb = new JTabbedPane(JTabbedPane.TOP);
tabb.setBounds(0, 0, 400, 300);
panel.add(tabb);
JPanel panel = new JPanel();
tabb.addTab("vis vare", null, panel, null);
panel.setLayout(null);
tabellinnhold = new DefaultTableModel(defaulttabell,kolonnenavn);
bytabell = new JTable(tabellinnhold);
rullefelt = new JScrollPane(bytabell);
panel.add(rullefelt);
add(panel);
koble = new JButton("koble til");
lukke = new JButton("lukke");
hente = new JButton("Hente data");
avslutt = new JButton("Avslutt");
// legger til knappepanel
panel.setLayout(new GridLayout(1,4));
panel.add(koble);
panel.add(lukke);
panel.add(hente);
panel.add(avslutt);
//action drit
koble.addActionListener(this);
lukke.addActionListener(this);
hente.addActionListener(this);
avslutt.addActionListener(this);
}