fix right-clicking close tab button closes popup menu

This commit is contained in:
PureCS 2024-03-28 20:26:52 +00:00
parent 13bf3cd841
commit 6d37e3ed12

AI 샘플 코드 생성 중입니다

Loading...

View File

@ -6,6 +6,7 @@ import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
public class CloseButtonComponent extends JPanel {
@ -45,6 +46,9 @@ public class CloseButtonComponent extends JPanel {
button.addMouseListener(new MouseClickedListener(e ->
{
if (e.getButton() != MouseEvent.BUTTON1) // left-click
return;
if (pane.indexOfTabComponent(CloseButtonComponent.this) != -1)
pane.remove(pane.indexOfTabComponent(CloseButtonComponent.this));
}));