Przeglądaj źródła

Remove unnecessary menu

master
Ben Kurtovic 12 lat temu
rodzic
commit
a23aee72f1
1 zmienionych plików z 2 dodań i 8 usunięć
  1. +2
    -8
      src/Render.java

+ 2
- 8
src/Render.java Wyświetl plik

@@ -17,23 +17,19 @@ public class Render extends Canvas implements Runnable, MouseListener,
public static int width;
public static int height;
public static int scale;
public int fps_now;
public int fps_now;
public boolean paused;
public String rule;
public boolean reset;
private Grid _grid;
private int[] _pixels;
private BufferedImage _image;
private long _lastTick;
private String[] _rules;
private JFrame _frame;
private JButton pauseButton;
private Random random = new Random();
public Render(int width, int height, Grid g, String[] rules) {
@@ -80,15 +76,13 @@ public class Render extends Canvas implements Runnable, MouseListener,
private void setFrame() {
JMenuBar menuBar = new JMenuBar();
JMenu menuMain = new JMenu("Menu");
JMenu menuAlgo = new JMenu("Algorithms");
for (String rule : _rules) {
JMenuItem menuAlgoItem = new JMenuItem(rule);
menuAlgo.add(menuAlgoItem);
menuAlgoItem.addActionListener(this);
}
menuMain.add(menuAlgo);
menuBar.add(menuMain);
menuBar.add(menuAlgo);
pauseButton = new JButton("Pause");
pauseButton.setActionCommand("pause");


Ładowanie…
Anuluj
Zapisz