Skip to content

Instantly share code, notes, and snippets.

@tychobrailleur
Created April 11, 2020 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tychobrailleur/5fcba2c545cc09539b3f28e7a2a7e48e to your computer and use it in GitHub Desktop.
Save tychobrailleur/5fcba2c545cc09539b3f28e7a2a7e48e to your computer and use it in GitHub Desktop.
import com.github.weisj.darklaf.DarkLaf;
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.theme.DarculaTheme;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
public class TestHOMainFrame extends JFrame {
public static void main(String[] args) {
TestHOMainFrame frame = new TestHOMainFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
try {
LafManager.setTheme(new DarculaTheme());
UIManager.setLookAndFeel(DarkLaf.class.getCanonicalName());
SwingUtilities.updateComponentTreeUI(frame);
} catch (Exception e) {
e.printStackTrace();
}
// HOTabbedPane tabbedPane = new HOTabbedPane();
JTabbedPane tabbedPane = new JTabbedPane();
for (int i = 0; i < 5; i++) {
tabbedPane.addTab("Tab " + (i+1), new JPanel());
tabbedPane.setPreferredSize(new Dimension(600, 400));
}
frame.getContentPane().add(tabbedPane);
frame.setTitle("Example of HOTabbedPane");
frame.pack();
SwingUtilities.invokeLater(() -> frame.setVisible(true));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment