Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Color;

import javax.swing.JButton;
import javax.swing.JTabbedPane;

public class Main {
    public static void main(String[] argv) throws Exception {
        JTabbedPane pane = new JTabbedPane();
        pane.setForeground(Color.YELLOW);
        pane.setBackground(Color.MAGENTA);
        String label = "Tab Label";
        pane.addTab(label, new JButton("Button"));

        int index = pane.getTabCount() - 1;

        pane.setForegroundAt(index, Color.ORANGE);
        pane.setBackgroundAt(index, Color.GREEN);
    }
}