How do I position JTabbedPane on the bottom half of the screen?

1

I would like to have my screen split into at least two parts, at the top I will add some fields, and at the bottom, a% with_with% of tabs. The problem is that I do not know how to do this, I can only do JTabbedPane occupying the entire screen.

Here's an image to illustrate:

Screen:

packagetabbedpane;importjava.awt.Dimension;importjavax.swing.JComponent;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JPanel;importjavax.swing.JTabbedPane;publicclassTelaextendsJFrame{JTabbedPanetabbedPane=newJTabbedPane();publicTela(){setTitle("Apenas um EXEMPLO");
        tabbedPane.addTab("Página 1", painel1());
        tabbedPane.addTab("Página 2", painel2());
        add(tabbedPane);
        setResizable(false);
        setVisible(true);
        setSize(600, 500);
        setLocationRelativeTo(null);
        setMinimumSize(new Dimension(getWidth(), getHeight()));
         setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    }

    public static void main(String[] args) {
        Tela tela  = new Tela();
    }

    public JComponent painel1() {
        JPanel painel1 = new JPanel();       
        JLabel label1;     
        label1 = new JLabel("Página 1");
        painel1.add(label1);
        return painel1; // retorna painel.
    }

    public JComponent painel2() {
        JPanel painel2 = new JPanel();       
        JLabel label2;
        label2 = new JLabel("Página 2");
        painel2.add(label2);
        return painel2;
    }
}
    
asked by anonymous 02.12.2016 / 18:03

1 answer

1

You can only make two changes:

02.12.2016 / 18:12