Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a Google-chrome-like title bar for Java SWT application

alt text

I have inherited development of a Java/SWT application running on Windows only. One of the feature requests that I need to scope is a Google-chrome-type title bar in place of the SWT windows title bar. The application's tabs appear at the same level as the window control buttons.

My understanding is that I will need to:

  • write a Windows widget capable of rendering the custom look and managing tabs as opposed to menus.
  • expose the Windows widget as a dll for use in Java via JNI
  • write a custom SWT widget to wrap it and expose the tab management interface.

I have a lot of experience with Java programming, GUI programming with Swing/AWT, and non-GUI C# programming. Windows GUI programming and SWT are new to me so I'm not sure where to start. The best I have found so far is a 2001 article on writing your own SWT widget.

My biggest unknown is the best way to implement a custom Windows application-window.

like image 457
MartyC Avatar asked Oct 27 '09 18:10

MartyC


2 Answers

You can create a Shell instance without a TITLE flag and then render Google-chrome-like tabs manually. This way you can even create a non-rectangular windows

like image 123
Eugene Kuleshov Avatar answered Nov 15 '22 16:11

Eugene Kuleshov


when dealing with things that are not yet in the JNI layer of SWT, you should always remember that you can quickly prototype things with JNA. When the JNA prototype, then you can either extend SWT's native interface or create your own separate JNI layer (This is an approach that worked well for me a number of times when dealing with SWT Carbon/Cocoa widgets)

like image 20
L. Mihalkovic Avatar answered Nov 15 '22 16:11

L. Mihalkovic