How to build a Google-chrome tabs and menubar interface in Java Swing? [closed]

旧城冷巷雨未停 提交于 2019-12-04 10:20:11

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.

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.

stolsvik

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!