Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1 Fix main menu bar for RedHat Linux

open
nobody
5
2005-10-13
2005-10-13
Eleanor Howe
No

This bug report was submitted by Thomas J Boyle
(biowolp@u.washington.edu)

[excerpt from the email]

This program wants to bring up a wide very short window
at the top of the screen. This has a menu that mainly
allows you to launch single or multiple array viewers
which seem to be substantially independent windows once
they are up. In my installation, the most typical
successful launch using ./tmev.sh is for a short and
narrow window to show up briefly and then expand itself
to the full screen width. One failure is that at the
point of expanding the window will disappear entirely.
A second failure mode is that the short window will
appear with text that is probably its menu showing but
then it will never expand. Note that in all successful
launches the short narrow window that first appears
shows only gray background so if you see text scrunched
up in the short window there is no point in waiting
around to see if it will fix itself.

THE FIX involves a change in Manager.initializeFrame().

Here is how the code you are shipping does this:

public void initializeFrame() {
frame = new JFrame("TIGR MultiExperiment Viewer");
frame.addWindowListener(eventListener);
frame.setVisible(true);

initializeMenuBar(frame);
frame.setSize(frame.getPreferredSize());

frame.validate();
frame.setResizable(false);
}

Here is the rearrangement I used to get it to work
reliably on my redhat linux installation:

public void initializeFrame() {
frame = new JFrame("TIGR MultiExperiment Viewer");
frame.addWindowListener(eventListener);

initializeMenuBar(frame);
frame.setSize(frame.getPreferredSize());

frame.setResizable(false);
frame.setVisible(true);
}

The bebavior I describe where one first sees a small
window appear and then, when successful, jump to the
full screen width is a consequence of setting the
window visible before it has been sized. When
setVisible is done last, there is no need for the call
to JFrame.validate().

[end excerpt]

I have tried implementing the changes he suggested but
only ended up breaking the display on my Win2k machine.
Perhaps someone with more Java GUI experience could
handle this one.

Discussion

  • Eleanor Howe
    Eleanor Howe
    2005-10-13

    • summary: Fix main menu bar for RedHad Linux --> Fix main menu bar for RedHat Linux
     
  • Annie Liu
    Annie Liu
    2005-10-18

    Logged In: YES
    user_id=1349458

    I think this problem was already fixed in version 3.1.
    Here's what it does now in the codes I have:

    public void initializeFrame() {
    frame = new JFrame("TIGR MultiExperiment Viewer");
    frame.addWindowListener(eventListener);

    initializeMenuBar(frame);
    frame.setSize(frame.getPreferredSize());

    frame.setResizable(false);
    frame.pack();
    frame.setVisible(true);
    }

    What he suggested is right - to package up everything before
    you set it visible. Also notice that you need a
    "frame.pack()" to get it to show up right in WindowXP. That
    might be the problem with the Windows2000 machine.