Java Swing applications do not work with appmenu

Reported by Jesse Glick on 2012-04-18
226
This bug affects 49 people
Affects Status Importance Assigned to Milestone
AppMenu GTK+
Wishlist
Unassigned
DBus Menu
Wishlist
Unassigned
libdbusmenu (Ubuntu)
Wishlist
Unassigned

Bug Description

Bug #618587 tracks integration of appmenu with SWT, but there appears to be nothing filed about integration with javax.swing.JMenuBar (mentioned at the bottom of bug #659931).

Expected (at least ideal) behavior: when running Unity and giving focus to a JFrame with a JMenuBar, the menu bar is not displayed inside the frame, but corresponding menus are displayed in the global Unity menu.

Actual behavior on 11.10: the menu bar is displayed inside the frame, and appmenu is empty.

For comparison, the Mac OS X JRE automatically displays Swing menus in the native location. libjava-gnome-java is perhaps the place to put in such a fix; assuming the JRE itself is not modified, an application wishing to take advantage of the fix would probably need to try to load /usr/share/java/gtk.jar and (if present) call a simple "register" method.

Changed in dbusmenu:
status: New → Confirmed
Changed in libdbusmenu (Ubuntu):
status: New → Confirmed
Changed in dbusmenu:
importance: Undecided → Wishlist
Changed in libdbusmenu (Ubuntu):
importance: Undecided → Wishlist
Changed in appmenu-gtk:
status: New → Confirmed
importance: Undecided → Wishlist
jaap@eight.nl (jaap-eight) wrote :

Jetbrains IDE's are Swing applications. Here's a related issue for this ticket: http://youtrack.jetbrains.com/issue/IDEA-69424

I've also added a screenshot of how menu's currently look in Ubuntu 12.04 (barely readable).

Jesse Glick (jesse-glick) wrote :

The readability problem may be bug #932274.

Dan Jared (danjaredg) wrote :

I create the Java Ayatan proyect http://code.google.com/p/java-swing-ayatana/ to integrate a java swing applications with Ubuntu, for the moment, I create a netbeans plugin http://plugins.netbeans.org/plugin/41822/?show=true.

But I can integrate any Java Swing Application with Ubuntu, but I need help to include this libraries (C library and Java Libraries) in a ppa repository.

If anyone knows, please help me...

Vadim Peretokin (vperetokin) wrote :

Dan Jared's Jayatana project seems to work! Is there anyone available to package it in a PPA?

Bruno Nova (brunonova) wrote :

I've packaged Jayatana to my PPA. The package works for OpenJDK 7 only.
Add "ppa:brunonova/ppa" to the software sources and install the "openjdk-7-jayatana" package.
It seems to be working (at least in Raring).

However, it appears Jayatana doesn't work in Saucy (for now, at least), so I have not uploaded a version for Saucy.

Dan Jared (danjaredg) wrote :

Hi Bruno, sounds great, I'm working on version 2, with support all Java Version including Open JDK 6 and it doesn't need endorsed libraries, only require a _JAVA_OPTIONS environment variable to work, also it only need a shell file in /etc/profile.d because it's based on Java Agent (like a debug process).

But I don't have any idea how create a ppa repository, can you help me to publish a new version of JAyatana?

Bruno Nova (brunonova) wrote :

Yes, I can help you. Warn me when you create a new version, and I'll try to package it if I'm available (note: I'm not very experienced).

But, if you would like to package it yourself, look around the Internet to learn how to package software.
I've learned a lot from "Debian New Maintainers' Guide" (pdf at http://www.debian.org/doc/manuals/maint-guide/maint-guide.en.pdf).
Launchpad help was also useful (https://help.launchpad.net/Packaging/PPA/Uploading).
If you have my PPA in the software sources (and also enable the source code repository of that PPA), you can run "apt-get source jayatana" to get the source of the package. You could use that as a base.

Hanine HAMZIOUI (hanynowsky) wrote :

Great!
#Jarded it would be nice to make a debian file available for users who don't want to add a PPA to their software sources.
In my opinion, we should ask that Jayatana becomes a default package in Ubuntu. Seems like Ubuntu developer barely care about Java desktop applications.
Eventually, look at this bash script that produces a Debian File from your executable JAR file:

http://hanynowsky.wordpress.com/2012/11/30/a-lazy-way-to-debianize-a-java-application/

Bruno Nova (brunonova) wrote :

Dan Jared has released version 2 of Jayatana and published it to his PPA.
Thank you! Great work!

Here's a post in Web Upd8 with instructions on how to install it: http://www.webupd8.org/2014/02/get-unity-global-menu-hud-support-for.html

It would be great if Jayatana was added to the official Ubuntu repositories!

Bruno Nova (brunonova) wrote :

By the way Dan Jared, maybe you could grab the Debian source package of the old version of JAyatana (for Ubuntu 12.04-13.04) from my PPA and add it to your own (you can make some changes if you want).
That way, your PPA will make JAyatana available for Ubuntu 12.04-13.10.

Dan Jared (danjaredg) wrote :

The JAyatana 2.x is relesed for Saucy with PPA ppa:danjaredg/jayatana, for install check comment #9, new version works with OpenJDK 6/7 and Oracle Java 6/7, and it doesn't need any plugin for Java Swing Applications or JVM.

Enjoy it.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers