Question

Does someone know an open source project or code snippets, which demonstrate how to create a google-chrome like interface with similar tabs and toolbar in Swing?

I know, that I can use JTabbedPane, but I'm thinking of an interface which looks and feels very similar to the google chrome "tabbed browsing".

Was it helpful?

Solution

I have just created my own open-source library for this, called Jhrome. Check it out!

It's available on github: https://github.com/jedwards1211/Jhrome

Documentation is sparse right now, but it's pretty solid, except for AWT/Swing memory leaks I haven't figured out yet. If enough people are interested in it I'll polish it up.

OTHER TIPS

You can probably pull it off with an undecorated JFrame (setUndecorated(true)) to get rid of the title bar.

You'd then create a layout with a tabbed pane filling the window and then overlay the min/max/close buttons on the top right.

If tabbed pane is too inflexible, you will need to put a button bar across the top, with toggle buttons controlling multiple content panels, and do the tab look yourself; as each button becomes active it hides the current panel and unhides the panel that belongs to it.

I think you should opt to Substance LAF and make a Chrome-lookalike skin for it (Substance is a skinnable LAF which sort of extends Swing's functionality on the graphical side) and use that, won't be the easiest way to do it but if you have the time and willpower, you'll get exactly what you want.

Look at this question (and its answers) too: JTabbedPane: Components before and after the tabs themselves.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top