🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7843

Re: JPopup Menu's isPopupTrigger()

#7843
From: Frank Plaßmeier
Date: Wed, 03 Jan 2001 11:29
68 lines
2958 bytes
This is a multi-part message in MIME format.
--------------C1BD8ADA13E59DF5C41E4A1E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The isPopupTrigger() method behavior is indeed sensitive to the OS resp.
Window System. We encountered it
when running a "porting" a Windows application to Solaris.
In order to avoid checking the OS property, the best cross platform
solution is presumably to
use the following approach (extracted from a custom tree component) :

private class TreeSpecificMouseAdapter extends MouseAdapter {

    public void mouseExited(MouseEvent e) {
      isPopup = false;
      // tree specific actions
    }

    public void mousePressed(MouseEvent e) {
      isPopup = e.isPopupTrigger();
    }

    public void mouseReleased(MouseEvent e) {
      isPopup |= e.isPopupTrigger();
    }

    public void mouseClicked(MouseEvent e) {
       //  tree specific actions, node selection etc.
        if (isPopup) {
          isPopup = false;
        //  show appropriate pop  up menu
        }
        else {
        // initiate direct action, e. g. default operation
       }
    }

    private boolean isPopup = false;

  }

Kind regards,
Frank Plassmeier

--------------C1BD8ADA13E59DF5C41E4A1E
Content-Type: text/x-vcard; charset=us-ascii;
 name="Frank.Plassmeier.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Frank Pla�meier
Content-Disposition: attachment;
 filename="Frank.Plassmeier.vcf"

begin:vcard 
n:Pla�meier;Frank
tel;cell:+49 (0) 177 737 14 85
tel;fax:+49 (0) 421 539 45 29
tel;work:+49 (0) 421 539 46 55
x-mozilla-html:FALSE
org:ASTRIUM SI;IO 61
adr:;;P. O. Box 28 61 56;Bremen;;D-28361;Germany
version:2.1
email;internet:Frank.Plassmeier@ri.dasa.de
title:Dipl.-Inform.
fn:Frank Pla�meier
end:vcard

--------------C1BD8ADA13E59DF5C41E4A1E--
Technical Details
Message-ID: <3A530D35.6F3728C4@ri.dasa.de>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!xfer13.netnews.com!netnews.com!news-peer-europe.sprintlink.net!news.sprintlink.net!news.algonet.se!algonet!news000.worldonline.se!news-sto.telia.net!News.Amsterdam.UnisourceCS!newsfeed-zh.ip-plus.net!news.ip-plus.net!bornews.borland.com!not-for-mail
References: <9225eh$q6i3@bornews.inprise.com> <92usqg$ch911@bornews.inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,40673252ea84e843
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2001-01-03 03:32:05 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!xfer13.netnews.com!netnews.com!news-peer-europe.sprintlink.net!news.sprintlink.net!news.algonet.se!algonet!news000.worldonline.se!news-sto.telia.net!News.Amsterdam.UnisourceCS!newsfeed-zh.ip-plus.net!news.ip-plus.net!bornews.borland.com!not-for-mail
From: Frank Plaßmeier <Frank.Plassmeier@ri.dasa.de>
Newsgroups: borland.public.jbuilder.java.swing
Subject: Re: JPopup Menu's isPopupTrigger()
Date: Wed, 03 Jan 2001 12:29:57 +0100
Organization: Another Netscape Collabra Server User
Lines: 69
Message-ID: <3A530D35.6F3728C4@ri.dasa.de>
References: <9225eh$q6i3@bornews.inprise.com> <92usqg$ch911@bornews.inprise.com>
NNTP-Posting-Host: 149.243.232.3
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------C1BD8ADA13E59DF5C41E4A1E"
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en