Closed Bug 132376 Opened 23 years ago Closed 23 years ago

Browser popup menu displays in applet area

Categories

(Core Graveyard :: Java: OJI, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED WORKSFORME

People

(Reporter: ebuck, Assigned: beard)

References

()

Details

Expected behavior: When you right click (or control-click) on the applet, you see the applet popup menu. If you right click outside the applet window, you see the browser popup menu. Bug Behavior: In Netscape 6.2 (Gecko 20011022 with MRJPlugin 1.0b2) for Mac OS X (OS 10.1.1), both menus show when you right click on the applet. First, the applet popup menu shows (as expected), then when an item is selected or the menu is otherwise cancelled, the browser popup menu shows (no expected). This occurs whether or not the event is consumed by the applet. This bug does not occur with Internet Explorer 5.1 on OS X, or any any browser on Windows For a 1-button mouse, test with Ctrl-Click instead of right click. Demo source: import java.awt.*; import java.applet.*; import java.awt.event.*; public class PopupMenuTest extends Applet implements ActionListener, MouseListener { PopupMenu popup; public void init() { System.out.println("Started applet"); MenuItem mi; Label l1 = new Label("Right-Click or Contrl-Click Here"); add(l1); popup = new PopupMenu("Edit"); mi = new MenuItem("Cut"); mi.addActionListener(this); popup.add(mi); mi = new MenuItem("Copy"); mi.addActionListener(this); popup.add(mi); popup.addSeparator(); mi = new MenuItem("Paste"); mi.addActionListener(this); popup.add(mi); addMouseListener(this); add(popup); // add popup menu to applet enableEvents(AWTEvent.MOUSE_EVENT_MASK); resize(200, 200); } public void paint(Graphics g){ g.setColor(Color.gray); g.fillRect(0,0,200,200); } public void mouseClicked(MouseEvent e) { } public void mouseEntered ( MouseEvent e ) { } public void mouseExited ( MouseEvent e ) { } public void mousePressed ( MouseEvent e ) { int input_modifiers = e.getModifiers ( ); if ((input_modifiers & e.BUTTON3_MASK) != 0 || (input_modifiers & e.BUTTON2_MASK) != 0) { popup.show(e.getComponent(), e.getX(), e.getY()); } //super.processMouseEvent(e); e.consume(); } public void mouseReleased ( MouseEvent e ) { } public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command.equals("Cut")) { // perform cut operation } else if (command.equals("Copy")) { // perform copy operation } else if (command.equals("Paste")) { // perform paste operation } } }
oji
Component: Plug-ins → OJI
QA Contact: shrir → pmac
In my opinion, this is more likely a plugins bug, not just a bug in the Java plugins.
Status: UNCONFIRMED → NEW
Ever confirmed: true
It works for me as well -- using WorksForMe using MRJPlugin 1.0FC1 and Mozilla build 20020310.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
Sorry, disregard last update -- I was intending to update a different bug report.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
This wfm in the 2002-10-14-05 trunk build under 10.2.1.
WFM in the trunk build (2002-10-14-03) under OS X 10.2.1
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
QA Contact: pmac → petersen
Resolution: --- → WORKSFORME
Verified
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.