This commit is contained in:
pro.boooooo
2022-11-27 13:10:18 +01:00
parent 7d122608b3
commit 7dd1cbbf33
7 changed files with 119 additions and 51 deletions

View File

@@ -7,9 +7,7 @@ package Test;
* 28/09/2022 at 20:35
* */
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.ImageIcon;
import javax.swing.*;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.event.WindowEvent;
@@ -21,7 +19,7 @@ import java.awt.event.WindowEvent;
*/
public class BFrame extends JFrame {
private final String title;
private String title;
private int location_x = 1;
private int location_y = 1;
private int width = 500;
@@ -100,6 +98,30 @@ public class BFrame extends JFrame {
initBFrame(layout, layout_row, layout_col);
}
/**
* Pour creer une fenetre modal
*
* @param title Le titre de la fenetre
* @param loca_x La localisation en x de la fenetre
* @param loca_y La localisation en y de la fenetre
* @param size_x La longueur de la fenetre
* @param size_y La largeur de la fenetre
* @param daron La fenetre qui va etre bloquer
* @param content Contenu de la fenetre
* */
public BFrame(String title, int loca_x, int loca_y, int size_x, int size_y, BFrame daron, JPanel content) {
JDialog frame = new JDialog(daron, title, true);
frame.setLocation(loca_x, loca_y);
frame.setSize(size_x, size_y);
frame.getContentPane().add(content);
JScrollPane scrollPane = new JScrollPane();
frame.getContentPane().add(scrollPane);
scrollPane.setViewportView(content);
frame.setVisible(true);
}
/**
* Initialiser la fenetre sans Layout par def.
*/