Hi.
I'm trying to add some components in several tabs, but they do not seem to be showing. I've tried to change around a lot of things and re-writing the whole thing, but I still can't get it to work.
It needs to be said that I'm writing Java as an hobby so I've not studied it, so you'd propably see many flaws.
Here's my sources:
core.java
start.javaCode:import javax.swing.*;
import java.awt.*;
public class core {
private JTabbedPane tab = new JTabbedPane();
private Component[] tabComponents = {new start(), new quests()};
private String[] tabCaptions = {"Start", "Quests"};
public static void main(String[] args) {
core Engine = new core();
}
public core(){
JFrame window = new JFrame("Window");
for(int i = 0; i <= tabComponents.length - 1; i++) {
tab.addTab(tabCaptions[i], new JScrollPane(tabComponents[i]));
}
window.add(tab, BorderLayout.CENTER);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setSize(500, 300);
window.setVisible(true);
}
}
Code:import javax.swing.*;
public class start extends JComponent{
public start() {
add(new JLabel("Start"));
}
}
(I used the PHP BB tags for the colouring, just not to confuse anyone)Code:import javax.swing.*;
public class quests extends JComponent{
public quests() {
add(new JLabel("Quests"));
}
}

