Note that there are some explanatory texts on larger screens.

plurals
  1. POJava GUI buttons not drawn sometimes (random). Compiz problem
    primarykey
    data
    text
    <p>*<strong>EDIT 2</strong>: 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. </p> <p>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.*</p> <p><strong>Original post:</strong> 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).</p> <p>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.)</p> <p>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.</p> <p>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?</p> <p>EDIT: 2011.07.05 This is what the code looks like in general:</p> <pre><code>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); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload