Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6075619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:30:53+00:00 2026-05-23T10:30:53+00:00

* EDIT 2 : I just discovered that this is a compiz+java GUI problem.

  • 0

*EDIT 2: I just discovered that this is a compiz+java GUI problem. It apparently happens where those two elements intersect.
I’m running the latest Ubuntu 11.04 (classic desktop, not Unity) with all updates. The problem happens with both Sun java and OpenJDK. It is related to using the Window-Rules Compiz plugin — which I need to use.

As stated in comments below, I previously verified that my controls are added to the correct thread. Now I found that disabling the Compiz Window-Rules plugin resolves my issue. Since I need to use the plugin, I am looking for a solution.*

Original post: I am working on a Java swing application. It was built with NetBeans 6.9. It uses GridBagLayout manager. The look and feel is currently Nimbus (but that doesn’t seem to have any effect on the issue I’m going to describe). Most users run the app on Linux. A few use Windows. Most of the time the app works fine. But at random times a view will open without some of the GUI buttons. For example, the Save and Cancel buttons might be missing. The other GUI elements will usually be present (although once I have heard that a view was completely empty with no GUI elements — just an empty gray window).

If the user closes that view with the “X” in the upper corner and simply re-opens it, it will be drawn correctly. The missing buttons issue happens less than 1% of the time. The close/reopen sequence fixes it almost 100% of the time. (A second close/reopen may have been needed once, if I recall correctly.)

Typically, if some buttons are missing, the other elements are still drawn correctly. This does not affect the whole view (form). It seems to affect the lowermost panel, but I’m not sure if that is actually a repeatable pattern. It is very difficult to reproduce this. I use the software every day and I see this less than once a month. A few users see it more frequently, but it is still rare.

There are no error messages. I have no idea what to try next. This behavior has persisted across different computers, different Linux distros (although all are based on Debian), and many different code changes, including changing the layout manager. (We used the NetBeans GUI designer previously.) Any ideas?

EDIT: 2011.07.05
This is what the code looks like in general:

public void show_some_view() {
    setTitle(...)
    setLayout(new GridBagLayout());
    JPanel butnPanel = new JPanel();
    butnPanel.setLayout(new GridBagLayout());
    try {
        //add stuff to panels (butnPanel, etc.)
    } catch (Exception e) {
        Logger.log(e);
    }
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    int[] wh = ApplicationContext.get().getDisplayWidthxHeight();
    setSize(wh[0], wh[1]);
    setFocusable(true);
    setVisible(true);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:30:53+00:00Added an answer on May 23, 2026 at 10:30 am

    But at random times a view will open without some of the GUI buttons.

    1. Make sure you add the buttons to the GUI on the EDT. Read the section from the Swing tutorial on Concurrency for more information.

    2. Make sure you add the buttons to the GUI BEFORE invoking setVisible(true);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: Just to make things clear, this problem was caused by a typo in
I just discovered, quite by accident, that this seems to work: Public Interface Ix
This is driving me crazy. Just testing a site on IE9 and discovered that
EDIT : Removing the 'index.php' with .htaccess creates this probem I just discovered. Now
EDIT I've just started skimming Codd's famous 1970 paper that started it all, that
Edit: I fixed the problem by just starting from scratch. Sorry to waste y'alls
** EDIT ** Nevermind, just needed to take out the parens... I get this
I just can't remember the terminology used for this and other related properties. EDIT
edit alright, I guess C is painful in nature--Just, this part, is particularly painful.
I have just successfully installed CakePHP and I see that I can edit the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.