Skip to content

Commit

Permalink
Fixed bug where application menus would be displayed behind the main …
Browse files Browse the repository at this point in the history
…GUI panel on Windows Vista and Windows 7 machines. The fix requires some OS-checking before deciding whether to add the app menus to the application's owner frame (for Mac OS X) or to itself (for everything else). Yuck.
  • Loading branch information
jmurty committed Feb 14, 2009
1 parent 5dcd8bd commit 212e399
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/org/jets3t/apps/cockpit/Cockpit.java
Expand Up @@ -171,6 +171,7 @@ public class Cockpit extends JApplet implements S3ServiceEventListener, ActionLi

public static final String JETS3T_COCKPIT_HELP_PAGE = "http://jets3t.s3.amazonaws.com/applications/cockpit.html";
public static final String AMAZON_S3_PAGE = "http://www.amazon.com/s3";
public static final String OS_NAME_MAC = "Mac OS X";

public static final String APPLICATION_DESCRIPTION = "Cockpit/0.7.0";

Expand Down Expand Up @@ -528,10 +529,15 @@ public Component getTableCellRendererComponent(JTable table, Object value, boole
*/
private void initMenus() {
JMenuBar appMenuBar = new JMenuBar();
if (this.isStandAloneApplication) {
if (this.isStandAloneApplication && OS_NAME_MAC.equals(System.getProperty("os.name"))) {
/*
* We need to check we're running on a Mac before adding the menu to the
* owner frame, otherwise the menus will be displayed *behind* the main
* GUI panel on Windows Vista and later [sigh]
*/
ownerFrame.setJMenuBar(appMenuBar);
} else {
this.setJMenuBar(appMenuBar);
this.setJMenuBar(appMenuBar);
}

// Service menu
Expand Down

0 comments on commit 212e399

Please sign in to comment.