5

I know the following things, and was wondering if they can be combined to make Java use jump-lists in Windows:

  1. Windows displays Jump-Lists for supporting programs when a taskbar icon is right-clicked
  2. C++, C#, F#, and VB support this natively (as shown here)
  3. Java can import native capabilities using the JNA (as shown here)

Anybody have experience they can lend to help me create a jump-list for a Java app?

The J7Goodies library won't work, as it no longer exists.

Ben Leggiero
  • 25,904
  • 38
  • 161
  • 267

2 Answers2

5

The word "natively" is overstating the case a bit. WPF provides jump list support. That's not the same as C# providing it. (For Windows Forms people there's the Code Pack which is a set of managed wrappers.) And MFC provides jump list support which is also not the same as C++ providing it. Anyway, there are two things going on here. One is adding files you opened recently to that jumplist, which under some circumstances you can get for free. The other is adding arbitrary files (typically starting point templates etc) to the jumplist.

To add a file to the recent/frequent list, you call SHAddToRecentDocs, though you may not have to if, for example, you use the Common File Dialog control to open files, and/or the user double-clicks files to launch your app and open them (you have the file type registered.) Lots of folks suggest calling it anyway to be on the safe side. To add any old thing to the jumplist see http://msdn.microsoft.com/en-us/library/dd378402(v=VS.85).aspx.

How to call those from Java, I forget, but I hope they get you started.

Kate Gregory
  • 18,565
  • 8
  • 53
  • 85
  • Thanks for the help. It seems that the SWT does not have the exact method SHAddToRecentDocs. Is there any other way to do that? – Ben Leggiero Sep 24 '10 at 19:02
  • 2
    It's a Windows API function in Shell32.dll - so you want to use JNA or whatever the current "I need to call a native function of the underlying platform" mechanism is to call that function. – Kate Gregory Sep 25 '10 at 00:57
2

There is a Java library providing the new Windows 7 features for Java. It's called J7Goodies by Strix Code. You can create your own jump lists with it.

torn
  • 559
  • 5
  • 6