This commit is contained in:
Arthur
2021-04-13 15:57:01 +02:00
parent e991f4ff6c
commit 002653ada9
3 changed files with 19 additions and 13 deletions

View File

@@ -1,7 +1,9 @@
package lsystem.screen.main;
import javax.swing.*;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.*;
import java.awt.event.ActionListener;
import java.util.Arrays;
public class Tab extends JPanel{
@@ -17,8 +19,6 @@ public class Tab extends JPanel{
this.nbRules = nbRules;
this.nbTabs = nbTabs;
JPanel tab = new JPanel();
axiomList = textArea("Axiome : \n",nbTabs);
rulesList = textArea("Règles : \n",nbTabs+10);
@@ -65,17 +65,17 @@ public class Tab extends JPanel{
aboveComponents.add(lists);
aboveComponents.add(Iterations);
aboveComponents.setLayout(new GridLayout(1,4));
tab.add(aboveComponents);
tab.add(southComponents2);
tab.setLayout(new BoxLayout(tab,1));
close = new JButton("Close");
close.addActionListener(new Listener(frame,this.nbTabs,"Close",this));
tab.add(close);
this.add(aboveComponents);
this.add(southComponents2);
this.setLayout(new BoxLayout(this,1));
this.add(new JButton("Close"));
tabs.addTab("Génération"+String.valueOf(nbTabs), tab);
tabs.addTab("Génération"+String.valueOf(nbTabs),this);
}
public JTextArea textArea(String texte, int nb){
JTextArea res = new JTextArea();
@@ -129,4 +129,12 @@ public class Tab extends JPanel{
public int getNbIterations(){
return (int) itSpinner.getValue();
}
public JButton closeButton(MainFrame frame) {
close = new JButton("Close");
int size = 17;
close.setPreferredSize(new Dimension(size, size));
close.addActionListener(new Listener(frame,this.nbTabs,"Close",this));
return close;
}
}