mirror of
https://github.com/LucasVbr/LecteurPdfDoubleAffichage.git
synced 2026-05-13 17:11:51 +00:00
Ajout des raccourcis
This commit is contained in:
@@ -10,6 +10,7 @@ import lecteur_pdf.affichage.Fenetre;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -67,7 +68,13 @@ public class Menu extends JMenuBar {
|
||||
Ouvrir.addActionListener(this::actionPerformed);
|
||||
Fermer.addActionListener(this::actionPerformed);
|
||||
|
||||
// TODO raccourcis
|
||||
// Définis les raccourcis
|
||||
KeyStroke raccourciOuvrir
|
||||
= KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK);
|
||||
Ouvrir.setAccelerator(raccourciOuvrir);
|
||||
KeyStroke raccourciFermer
|
||||
= KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.CTRL_DOWN_MASK);
|
||||
Fermer.setAccelerator(raccourciFermer);
|
||||
|
||||
// Ajouter les éléments au menu "Fichier"
|
||||
Fichier.add(Ouvrir);
|
||||
|
||||
Reference in New Issue
Block a user